CI: split macOS/android checks
This commit is contained in:
committed by
Peter Steinberger
parent
30e22769bb
commit
cc07ea82a4
125
.github/workflows/ci.yml
vendored
125
.github/workflows/ci.yml
vendored
@@ -10,7 +10,28 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
runtime: [node, bun]
|
include:
|
||||||
|
- runtime: node
|
||||||
|
task: lint
|
||||||
|
command: pnpm lint
|
||||||
|
- runtime: node
|
||||||
|
task: test
|
||||||
|
command: pnpm test
|
||||||
|
- runtime: node
|
||||||
|
task: build
|
||||||
|
command: pnpm build
|
||||||
|
- runtime: node
|
||||||
|
task: protocol
|
||||||
|
command: pnpm protocol:check
|
||||||
|
- runtime: bun
|
||||||
|
task: lint
|
||||||
|
command: bunx biome check src
|
||||||
|
- runtime: bun
|
||||||
|
task: test
|
||||||
|
command: bunx vitest run
|
||||||
|
- runtime: bun
|
||||||
|
task: build
|
||||||
|
command: bunx tsc -p tsconfig.json
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -77,37 +98,42 @@ jobs:
|
|||||||
pnpm -v
|
pnpm -v
|
||||||
pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
|
pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
|
||||||
|
|
||||||
- name: Lint (node)
|
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
|
||||||
if: matrix.runtime == 'node'
|
run: ${{ matrix.command }}
|
||||||
run: pnpm lint
|
|
||||||
|
|
||||||
- name: Test (node)
|
|
||||||
if: matrix.runtime == 'node'
|
|
||||||
run: pnpm test
|
|
||||||
|
|
||||||
- name: Build (node)
|
|
||||||
if: matrix.runtime == 'node'
|
|
||||||
run: pnpm build
|
|
||||||
|
|
||||||
- name: Protocol check (node)
|
|
||||||
if: matrix.runtime == 'node'
|
|
||||||
run: pnpm protocol:check
|
|
||||||
|
|
||||||
- name: Lint (bun)
|
|
||||||
if: matrix.runtime == 'bun'
|
|
||||||
run: bunx biome check src
|
|
||||||
|
|
||||||
- name: Test (bun)
|
|
||||||
if: matrix.runtime == 'bun'
|
|
||||||
run: bunx vitest run
|
|
||||||
|
|
||||||
- name: Build (bun)
|
|
||||||
if: matrix.runtime == 'bun'
|
|
||||||
run: bunx tsc -p tsconfig.json
|
|
||||||
|
|
||||||
macos-app:
|
macos-app:
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- task: lint
|
||||||
|
command: |
|
||||||
|
swiftlint --config .swiftlint.yml
|
||||||
|
swiftformat --lint apps/macos/Sources --config .swiftformat
|
||||||
|
- task: build
|
||||||
|
command: |
|
||||||
|
set -euo pipefail
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
if swift build --package-path apps/macos --configuration release; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "swift build failed (attempt $attempt/3). Retrying…"
|
||||||
|
sleep $((attempt * 20))
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
- task: test
|
||||||
|
command: |
|
||||||
|
set -euo pipefail
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
if swift test --package-path apps/macos --parallel --enable-code-coverage --show-codecov-path; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "swift test failed (attempt $attempt/3). Retrying…"
|
||||||
|
sleep $((attempt * 20))
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -142,35 +168,8 @@ jobs:
|
|||||||
xcodebuild -version
|
xcodebuild -version
|
||||||
swift --version
|
swift --version
|
||||||
|
|
||||||
- name: SwiftLint
|
- name: Run ${{ matrix.task }}
|
||||||
run: swiftlint --config .swiftlint.yml
|
run: ${{ matrix.command }}
|
||||||
|
|
||||||
- name: SwiftFormat (lint mode)
|
|
||||||
run: swiftformat --lint apps/macos/Sources --config .swiftformat
|
|
||||||
|
|
||||||
- name: Swift build (release)
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
for attempt in 1 2 3; do
|
|
||||||
if swift build --package-path apps/macos --configuration release; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "swift build failed (attempt $attempt/3). Retrying…"
|
|
||||||
sleep $((attempt * 20))
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Swift tests (coverage)
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
for attempt in 1 2 3; do
|
|
||||||
if swift test --package-path apps/macos --parallel --enable-code-coverage --show-codecov-path; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "swift test failed (attempt $attempt/3). Retrying…"
|
|
||||||
sleep $((attempt * 20))
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
ios:
|
ios:
|
||||||
if: false # ignore iOS in CI for now
|
if: false # ignore iOS in CI for now
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
@@ -346,6 +345,14 @@ jobs:
|
|||||||
|
|
||||||
android:
|
android:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- task: test
|
||||||
|
command: ./gradlew --no-daemon :app:testDebugUnitTest
|
||||||
|
- task: build
|
||||||
|
command: ./gradlew --no-daemon :app:assembleDebug
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -385,6 +392,6 @@ jobs:
|
|||||||
"platforms;android-36" \
|
"platforms;android-36" \
|
||||||
"build-tools;36.0.0"
|
"build-tools;36.0.0"
|
||||||
|
|
||||||
- name: Android unit tests + debug build
|
- name: Run Android ${{ matrix.task }}
|
||||||
working-directory: apps/android
|
working-directory: apps/android
|
||||||
run: ./gradlew --no-daemon :app:testDebugUnitTest :app:assembleDebug
|
run: ${{ matrix.command }}
|
||||||
|
|||||||
Reference in New Issue
Block a user