Skip to content

feat(segkit): add ci wrap and ci summary subcommands #318

feat(segkit): add ci wrap and ci summary subcommands

feat(segkit): add ci wrap and ci summary subcommands #318

Workflow file for this run

name: PR Fast Checks
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Detect which paths changed to skip unnecessary jobs
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
segkit: ${{ steps.filter.outputs.segkit }}
android: ${{ steps.filter.outputs.android }}
ios: ${{ steps.filter.outputs.ios }}
rn: ${{ steps.filter.outputs.rn }}
shell: ${{ steps.filter.outputs.shell }}
ci: ${{ steps.filter.outputs.ci }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Detect changed paths
id: filter
env:
FILTER_DEFINITIONS: |
segkit:
- '^segkit/'
android:
- '^plugins/android/'
- '^examples/android/'
- '^plugins/tests/android/'
ios:
- '^plugins/ios/'
- '^examples/ios/'
- '^plugins/tests/ios/'
rn:
- '^plugins/react-native/'
- '^examples/react-native/'
- '^plugins/tests/react-native/'
shell:
- '^plugins/.*/scripts/'
ci:
- '^\.github/'
run: bash .github/actions/paths-filter/paths-filter.sh
# Linting and formatting checks (always runs)
lint:
name: Lint
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Run linting
run: devbox run lint
# Shell script unit tests (no SDK required)
test-shell-scripts:
name: Shell Script Tests
needs: [detect-changes]
if: needs.detect-changes.outputs.shell == 'true' || needs.detect-changes.outputs.ci == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Run Android lib.sh tests
run: devbox run bash plugins/tests/android/test-lib.sh
- name: Run Android apk-resolution tests
run: devbox run bash plugins/tests/android/test-apk-resolution.sh
- name: Run iOS lib.sh tests
run: devbox run bash plugins/tests/ios/test-lib.sh
- name: Run iOS app-resolution tests
run: devbox run bash plugins/tests/ios/test-app-resolution.sh
- name: Run React Native lib.sh tests
run: devbox run bash plugins/tests/react-native/test-lib.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: shell-script-test-logs
path: reports/logs/
retention-days: 7
# Device config tests (no SDK build, just config validation)
test-device-config:
name: Device Config Tests
needs: [detect-changes]
if: needs.detect-changes.outputs.android == 'true' || needs.detect-changes.outputs.ios == 'true' || needs.detect-changes.outputs.ci == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Run Android device config tests
env:
ANDROID_SDK_REQUIRED: "0"
run: devbox run bash plugins/tests/android/test-devices.sh
- name: Run iOS device config tests
env:
IOS_SDK_REQUIRED: "0"
run: devbox run bash plugins/tests/ios/test-devices.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: device-config-test-logs
path: reports/logs/
retention-days: 7
# Segkit CLI checks
segkit:
name: Segkit CLI
needs: [detect-changes]
if: needs.detect-changes.outputs.segkit == 'true' || needs.detect-changes.outputs.ci == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Remove system Rust toolchain
run: rustup self uninstall -y || true
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Cargo cache
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
segkit/target
key: ${{ runner.os }}-cargo-${{ hashFiles('segkit/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Check formatting
run: devbox run segkit:fmt:check
- name: Run clippy
run: devbox run segkit:clippy
- name: Run tests
run: devbox run segkit:test
# Android example E2E test (max device only on PRs)
android-e2e:
needs: [detect-changes]
if: needs.detect-changes.outputs.android == 'true' || needs.detect-changes.outputs.rn == 'true' || needs.detect-changes.outputs.ci == 'true'
uses: ./.github/workflows/e2e-android.yml
with:
devices: '["max"]'
timeout-minutes: 30
boot-timeout: 180
test-timeout: 300
free-disk-space: true
run-apk-detection-tests: true
artifact-prefix: android
# iOS example E2E test (max device only on PRs)
ios-e2e:
needs: [detect-changes]
if: needs.detect-changes.outputs.ios == 'true' || needs.detect-changes.outputs.rn == 'true' || needs.detect-changes.outputs.ci == 'true'
uses: ./.github/workflows/e2e-ios.yml
with:
matrix-include: '[{"device":"max","os":"macos-26"}]'
timeout-minutes: 25
boot-timeout: 120
test-timeout: 300
artifact-prefix: ios
# React Native E2E tests (max device only on PRs, plus web)
react-native-e2e:
needs: [detect-changes]
if: needs.detect-changes.outputs.rn == 'true' || needs.detect-changes.outputs.ci == 'true'
uses: ./.github/workflows/e2e-react-native.yml
with:
matrix-include: '[{"platform":"android","device":"max","os":"ubuntu-24.04"},{"platform":"ios","device":"max","os":"macos-26"},{"platform":"web","device":"none","os":"ubuntu-24.04"}]'
timeout-minutes: 45
artifact-prefix: react-native
# Summary status check (treats skipped jobs as success)
status-check:
name: All PR Checks Passed
runs-on: ubuntu-latest
needs: [lint, test-shell-scripts, test-device-config, segkit, android-e2e, ios-e2e, react-native-e2e]
if: always()
steps:
- name: Check job results
run: |
echo "PR Check Results:"
echo " Lint: ${{ needs.lint.result }}"
echo " Shell Script Tests: ${{ needs.test-shell-scripts.result }}"
echo " Device Config Tests: ${{ needs.test-device-config.result }}"
echo " Segkit CLI: ${{ needs.segkit.result }}"
echo " Android E2E: ${{ needs.android-e2e.result }}"
echo " iOS E2E: ${{ needs.ios-e2e.result }}"
echo " React Native E2E: ${{ needs.react-native-e2e.result }}"
echo ""
for result in \
"${{ needs.lint.result }}" \
"${{ needs.test-shell-scripts.result }}" \
"${{ needs.test-device-config.result }}" \
"${{ needs.segkit.result }}" \
"${{ needs.android-e2e.result }}" \
"${{ needs.ios-e2e.result }}" \
"${{ needs.react-native-e2e.result }}"; do
if [[ "$result" != "success" && "$result" != "skipped" ]]; then
echo "::error::One or more PR checks failed"
exit 1
fi
done
echo "::notice::All PR checks passed!"