# Every push and pull request: typecheck, unit tests, then the end-to-end tests with stand-ins (YOGURT_FAKE), hidden. # The Mac job runs everything; Windows and Linux typecheck, unit-test, build their helpers and run the e2e specs that work there. name: CI # Docs, licence text and the iPhone app (ios/, tested with swift test) don't run it. A newer push to the same branch # stops the run before it: macOS minutes cost ten times Linux ones. on: push: branches: [main] paths-ignore: ['docs/**', '**/*.md', 'LICENSE', 'ios/**'] pull_request: paths-ignore: ['docs/**', '**/*.md', 'LICENSE', 'ios/**'] workflow_dispatch: concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: test: # Xcode 26: the helpers use macOS 26's speech APIs. The Mac end-to-end tests are split over 4 machines at once # (about 53 min on one); this is a public repo, so the Mac runners cost nothing. Part 1 also typechecks and unit-tests. name: test (${{ matrix.shard }}/4) strategy: fail-fast: false matrix: shard: [1, 2, 3, 4] runs-on: macos-26 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - name: Xcode run: sudo xcode-select -s /Applications/Xcode_26.4.1.app && xcodebuild -version - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version-file: .nvmrc cache: pnpm - run: pnpm install --frozen-lockfile - name: Typecheck if: matrix.shard == 1 run: pnpm -r typecheck - name: Unit tests if: matrix.shard == 1 run: pnpm -r test - name: Prepare CI motion capture run: pnpm -C app exec playwright install ffmpeg - name: End-to-end tests # windows are shown on CI (nobody is watching) env: YOGURT_BACKGROUND: '0' run: pnpm -C app e2e --shard=${{ matrix.shard }}/4 - name: Keep agenda motion review if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: agenda-motion-${{ matrix.shard }} path: app/test-results/**/agenda-motion/*.webm if-no-files-found: ignore retention-days: 7 - name: Keep UI review captures if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ui-review-${{ matrix.shard }} path: | app/test-results/**/*.png app/test-results/**/scrub-motion/**/*.webm app/test-results/**/glass-native-*.txt if-no-files-found: ignore retention-days: 7 - name: Keep the test report if: failure() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: e2e-report-${{ matrix.shard }} path: app/test-results if-no-files-found: ignore other: # Windows and Linux: the app builds, its tests pass and it starts (fake mode) with the Mac-only features hidden strategy: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version-file: .nvmrc cache: pnpm - name: Linux build and test packages if: runner.os == 'Linux' # GitHub's Azure Ubuntu mirror sometimes can't be reached: after a failed try, use Ubuntu's own servers run: | get() { sudo apt-get update -qq && sudo apt-get install -y -qq --no-install-recommends libpulse-dev pkg-config pulseaudio >/dev/null; } for i in 1 2 3; do get && exit 0 echo "::warning::apt try $i failed; switching to archive.ubuntu.com" echo 'http://archive.ubuntu.com/ubuntu/' | sudo tee /etc/apt/apt-mirrors.txt >/dev/null sudo sed -i 's#http://azure.archive.ubuntu.com#http://archive.ubuntu.com#g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true sleep 10 done exit 1 - name: Rust build cache uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: | ~/.cargo/registry ~/.cargo/git app/native/*/target # per image: a build from one Ubuntu restored on another broke the 0.3.8 release ("can't find crate for zbus") key: helpers-ci-${{ matrix.os }}-${{ hashFiles('app/native/*/Cargo.lock', 'app/native/*/rust-toolchain.toml') }} - run: pnpm install --frozen-lockfile - name: Typecheck run: pnpm -r typecheck - name: Unit tests run: pnpm -r test - name: Build # the Rust helpers (scripts/native.mjs); whisper-server is left out here (fake mode doesn't use it), the preview builds and native-whisper.yml build it env: YOGURT_NO_WHISPER: '1' run: pnpm -C app build - name: The helpers run shell: bash run: | if [ "$RUNNER_OS" = Linux ]; then pulseaudio --start --exit-idle-time=-1; fi node app/scripts/helpers-smoke.mjs --resources app/resources --no-whisper - name: Install Playwright if: runner.os == 'Linux' run: pnpm -C app exec playwright install-deps # Ubuntu 24.04 blocks the user namespaces Electron's sandbox needs - name: Let Electron start (Linux) if: runner.os == 'Linux' run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 - name: End-to-end tests shell: bash # the specs tagged @everywhere (launch, and the Mac-only features hidden); windows are shown, hidden ones pause animation frames here env: YOGURT_BACKGROUND: '0' run: | cd app if [ "$RUNNER_OS" = "Linux" ]; then xvfb-run -a pnpm exec playwright test --grep @everywhere; else pnpm exec playwright test --grep @everywhere; fi # Windows: the real installer, clicked through page by page (custom install and models folders), then updated # over silently the way the app does it, then with the defaults (scripts/windows-installer-check.py) - name: Package the installer (Windows) if: runner.os == 'Windows' shell: bash env: CSC_IDENTITY_AUTO_DISCOVERY: 'false' run: | mkdir -p app/resources/vad cd app && pnpm exec electron-builder --win --publish never -c.extraMetadata.yogurtPreview=true - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 if: runner.os == 'Windows' with: python-version: '3.12' - name: Click through the installer (Windows) if: runner.os == 'Windows' timeout-minutes: 25 run: | python -m pip install --quiet pywinauto==0.6.9 pillow==11.1.0 python app/scripts/windows-installer-check.py app/dist/Yogurt-windows-x64.exe installer-pages - name: Keep the installer's pages if: always() && runner.os == 'Windows' uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: windows-installer-pages path: installer-pages if-no-files-found: ignore retention-days: 14 - name: Keep the test report if: failure() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: e2e-report-${{ runner.os }} path: app/test-results if-no-files-found: ignore