196 lines
5.3 KiB
YAML
196 lines
5.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: jdx/mise-action@v3
|
|
- run: mise fix
|
|
- run: |
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config user.name "github-actions[bot]"
|
|
git diff --exit-code || (git add . && git commit -m 'Apply mise fix' && git push)
|
|
git diff --exit-code
|
|
|
|
lint-hk:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: jdx/mise-action@v3
|
|
- run: mise check
|
|
|
|
lint-android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ./.github/actions/setup-gradle
|
|
- run: ./gradlew lint
|
|
|
|
test-android:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
api-level:
|
|
# the latest, Android 15 (Vanilla Ice Cream)
|
|
- 35
|
|
# the oldest we support, Android 7 (Nougat) (supports back to ~Galaxy S6 from 2015)
|
|
- 24
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ./.github/actions/setup-gradle
|
|
- run: ./gradlew testDebugUnitTest
|
|
- name: Run with AVD ./gradlew connectedDebugAndroidTest
|
|
uses: ./.github/actions/run-with-avd
|
|
with:
|
|
api-level: ${{ matrix.api-level }}
|
|
script: ./gradlew connectedDebugAndroidTest
|
|
|
|
test-ios:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- runner: macos-26
|
|
os_version: ^26
|
|
- runner: macos-26
|
|
os_version: ^18
|
|
name: test-ios (${{ matrix.os_version }})
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ./.github/actions/setup-gradle
|
|
- uses: futureware-tech/simulator-action@v4
|
|
id: setup-simulator
|
|
with:
|
|
os: iOS
|
|
os_version: ${{ matrix.os_version }}
|
|
- run:
|
|
./gradlew iosSimulatorArm64Test -- --device ${{
|
|
steps.setup-simulator.outputs.udid }}
|
|
|
|
test-js:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ./.github/actions/setup-gradle
|
|
- run: ./gradlew jsBrowserTest
|
|
|
|
test-desktop:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# TODO add alternative architectures
|
|
- runner: macos-latest # aarch64
|
|
- runner: ubuntu-latest # amd64
|
|
- runner: windows-latest # amd64
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- if: ${{ matrix.runner == 'windows-latest' }}
|
|
run: git config --global core.longpaths true
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
- uses: ./.github/actions/setup-cmake
|
|
- uses: ./.github/actions/setup-gradle
|
|
- run: ./gradlew desktopTest
|
|
|
|
build-docs:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ./.github/actions/setup-gradle
|
|
- run: ./gradlew generateDocs
|
|
- uses: actions/upload-pages-artifact@v4
|
|
with:
|
|
path: build/docs
|
|
|
|
build-android-app:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ./.github/actions/setup-gradle
|
|
- run: ./gradlew packageDebug
|
|
- uses: actions/upload-artifact@v5
|
|
with:
|
|
if-no-files-found: error
|
|
name: demo-app-android
|
|
path: demo-app/build/outputs/apk/debug/demo-app-debug.apk
|
|
|
|
build-desktop-app:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# TODO add alternative architectures
|
|
- runner: macos-latest # aarch64
|
|
artifact_type: dmg
|
|
artifact_name: demo-app-desktop-macos-aarch64
|
|
- runner: ubuntu-latest # amd64
|
|
artifact_type: deb
|
|
artifact_name: demo-app-desktop-linux-amd64
|
|
- runner: windows-latest # amd64
|
|
artifact_type: msi
|
|
artifact_name: demo-app-desktop-windows-amd64
|
|
runs-on: ${{ matrix.runner }}
|
|
name: build-desktop-app (${{ matrix.runner }})
|
|
steps:
|
|
- if: ${{ matrix.runner == 'windows-latest' }}
|
|
run: git config --global core.longpaths true
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
- uses: ./.github/actions/setup-cmake
|
|
- uses: ./.github/actions/setup-gradle
|
|
- run: ./gradlew :demo-app:packageDistributionForCurrentOS
|
|
- uses: actions/upload-artifact@v5
|
|
with:
|
|
if-no-files-found: error
|
|
name: ${{ matrix.artifact_name }}
|
|
path:
|
|
"demo-app/build/compose/binaries/main/${{ matrix.artifact_type }}/*"
|
|
|
|
all-good:
|
|
needs:
|
|
- format
|
|
- lint-hk
|
|
- lint-android
|
|
- test-android
|
|
- test-ios
|
|
- test-desktop
|
|
- test-js
|
|
- build-docs
|
|
- build-android-app
|
|
- build-desktop-app
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo 'All checks passed!'
|