CI Tests #119
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Tests | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: jdx/mise-action@v4 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Lint and type-check | |
| run: npm run build:tests | |
| - name: Check public API compatibility | |
| run: npm run check:api-compat | |
| android-test: | |
| needs: lint | |
| runs-on: bitrise-react-native-code-push-linux-runner | |
| strategy: | |
| matrix: | |
| variant: [bare, expo] | |
| include: | |
| - variant: bare | |
| test-command: test:android | |
| - variant: expo | |
| test-command: test:expo:android | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: jdx/mise-action@v4 | |
| - name: Cache npm packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.npm | |
| # Note about test.ts: some NPM package versions are hardcoded here and installed during the test run. | |
| key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json', 'test/test.ts') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm- | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Add Android tools to PATH | |
| run: | | |
| echo "/usr/local/lib/android/sdk/emulator" >> $GITHUB_PATH | |
| echo "/usr/local/lib/android/sdk/platform-tools" >> $GITHUB_PATH | |
| - name: Run Android Tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 27 | |
| target: google_apis | |
| arch: x86 | |
| disable-animations: true | |
| script: npm run ${{ matrix.test-command }} | |
| ios-test: | |
| needs: lint | |
| runs-on: bitrise-react-native-code-push-macos-runner | |
| strategy: | |
| matrix: | |
| variant: [bare, expo] | |
| include: | |
| - variant: bare | |
| test-command: test:ios | |
| - variant: expo | |
| test-command: test:expo:ios | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: jdx/mise-action@v4 | |
| - name: Cache npm packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.npm | |
| # Note about test.ts: some NPM package versions are hardcoded here and installed during the test run. | |
| key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json', 'test/test.ts') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm- | |
| - name: Run iOS Tests | |
| run: | | |
| npm install | |
| npm run ${{ matrix.test-command }} | |
| - name: Upload iOS Simulator crash reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-crash-logs-${{ matrix.variant }} | |
| path: test/crash-logs/ | |
| if-no-files-found: ignore |