Update GitHub Actions workflows for improved CI/CD process and depend… #3
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 Pipeline | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - '*.md' | |
| - 'screenshots/**' | |
| push: | |
| branches-ignore: | |
| - "main" | |
| paths-ignore: | |
| - '*.md' | |
| - 'screenshots/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Quick quality checks that can run in parallel | |
| quality-checks: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| check: [lint, test, typescript] | |
| steps: | |
| - name: 🛒 Checkout | |
| uses: actions/checkout@v4 | |
| - name: 🖥 Setup Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'yarn' | |
| - name: 🤖 Install dependencies | |
| run: yarn install --network-concurrency 1 --frozen-lockfile | |
| - name: 🔍 Run TypeScript Check | |
| if: matrix.check == 'typescript' | |
| run: yarn tsc | |
| - name: 🧪 Run Tests | |
| if: matrix.check == 'test' | |
| run: yarn test | |
| - name: 🦋 Check Linting & Formatting | |
| if: matrix.check == 'lint' | |
| run: | | |
| yarn lint | |
| yarn format:check | |
| # Build jobs that need more resources | |
| build-android: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| needs: quality-checks | |
| steps: | |
| - name: 🛒 Checkout | |
| uses: actions/checkout@v4 | |
| - name: 🖥 Setup Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'yarn' | |
| - name: ☕ Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'zulu' | |
| cache: 'gradle' | |
| - name: 💎 Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.0' | |
| bundler-cache: true | |
| - name: 💬 Set version | |
| run: echo VERSION_NUMBER=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV | |
| - name: 🤖 Install dependencies | |
| run: yarn install --network-concurrency 1 --frozen-lockfile | |
| - name: 🚀 Build Android APK | |
| run: yarn fastlane:android:build | |
| - name: 📦 Upload APK | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: jellify-android-pr-${{ github.event.number }}-${{ env.VERSION_NUMBER }} | |
| path: android/app/build/outputs/apk/release/*.apk | |
| retention-days: 7 | |
| if-no-files-found: warn | |
| build-ios: | |
| runs-on: macos-15 | |
| if: github.event_name == 'pull_request' | |
| needs: quality-checks | |
| steps: | |
| - name: 🛒 Checkout | |
| uses: actions/checkout@v4 | |
| - name: 🖥 Setup Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'yarn' | |
| - name: 💎 Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.0' | |
| bundler-cache: true | |
| - name: 🍎 Cache CocoaPods | |
| uses: actions/cache@v4 | |
| with: | |
| path: ios/Pods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: 💬 Set version | |
| run: echo VERSION_NUMBER=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV | |
| - name: 🍎 Install dependencies and pods | |
| run: yarn init-ios:new-arch | |
| - name: 🚀 Build iOS IPA | |
| run: yarn fastlane:ios:build | |
| env: | |
| APPSTORE_CONNECT_API_KEY_JSON: ${{ secrets.APPSTORE_CONNECT_API_KEY_JSON }} | |
| FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }} | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| MATCH_REPO_PAT: "anultravioletaurora:${{ secrets.SIGNING_REPO_PAT }}" | |
| - name: 📦 Upload IPA | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: jellify-ios-pr-${{ github.event.number }}-${{ env.VERSION_NUMBER }} | |
| path: | | |
| ios/build/*.ipa | |
| ios/*.ipa | |
| retention-days: 7 | |
| if-no-files-found: warn | |
| # Maestro tests only run when relevant paths change | |
| maestro-tests: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event_name == 'pull_request' && | |
| contains(github.event.pull_request.changed_files, 'maestro-tests/') || | |
| contains(github.event.pull_request.changed_files, 'src/') || | |
| contains(github.event.pull_request.changed_files, 'App.tsx') || | |
| contains(github.event.pull_request.changed_files, 'android/') | |
| needs: build-android | |
| env: | |
| JELLYFIN_TEST_ADDRESS: ${{ secrets.JELLYFIN_TEST_URL }} | |
| JELLYFIN_TEST_USERNAME: ${{ secrets.JELLYFIN_TEST_USERNAME }} | |
| JELLYFIN_TEST_PASSWORD: ${{ secrets.JELLYFIN_TEST_PASSWORD }} | |
| steps: | |
| - name: 🛒 Checkout | |
| uses: actions/checkout@v4 | |
| - name: ☕ Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'zulu' | |
| - name: 🤖 Cache Maestro CLI | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.maestro | |
| key: maestro-1.40.0 | |
| - name: 📥 Install Maestro | |
| run: | | |
| if [ ! -f ~/.maestro/bin/maestro ]; then | |
| export MAESTRO_VERSION=1.40.0 | |
| curl -Ls "https://get.maestro.mobile.dev" | bash | |
| fi | |
| echo "$HOME/.maestro/bin" >> $GITHUB_PATH | |
| - name: ⬇️ Download Android APK | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: jellify-android-pr-${{ github.event.number }}-* | |
| path: artifacts/ | |
| - 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: 🧪 Run Maestro Tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: '30' | |
| arch: x86_64 | |
| ram-size: '4096M' | |
| heap-size: '2048M' | |
| cores: '2' | |
| disable-animations: true | |
| enable-hw-keyboard: true | |
| script: | | |
| node scripts/maestro-android.js ${{ env.JELLYFIN_TEST_ADDRESS }} ${{ env.JELLYFIN_TEST_USERNAME }} ${{ env.JELLYFIN_TEST_PASSWORD }} | |
| - name: 📦 Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: maestro-test-results | |
| path: video.mp4 |