Skip to content

feat(segkit): add Rust CLI skeleton with testing and CI #273

feat(segkit): add Rust CLI skeleton with testing and CI

feat(segkit): add Rust CLI skeleton with testing and CI #273

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:
# Linting and formatting checks
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
# Segkit Rust CLI checks (fmt, clippy, tests)
segkit:
name: Segkit CLI
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
# Shell script unit tests (no SDK required)
test-shell-scripts:
name: Shell Script Tests
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
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
# Android example E2E test (max device only on PRs)
android-e2e:
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:
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:
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
status-check:
name: All PR Checks Passed
runs-on: ubuntu-latest
needs: [lint, segkit, test-shell-scripts, test-device-config, 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 " Segkit CLI: ${{ needs.segkit.result }}"
echo " Shell Script Tests: ${{ needs.test-shell-scripts.result }}"
echo " Device Config Tests: ${{ needs.test-device-config.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 ""
if [[ "${{ needs.lint.result }}" != "success" ]] || \
[[ "${{ needs.segkit.result }}" != "success" ]] || \
[[ "${{ needs.test-shell-scripts.result }}" != "success" ]] || \
[[ "${{ needs.test-device-config.result }}" != "success" ]] || \
[[ "${{ needs.android-e2e.result }}" != "success" ]] || \
[[ "${{ needs.ios-e2e.result }}" != "success" ]] || \
[[ "${{ needs.react-native-e2e.result }}" != "success" ]]; then
echo "::error::One or more PR checks failed"
exit 1
fi
echo "::notice::All PR checks passed!"