fix(test): eliminate race in PipeWire stub scripts causing flaky test #201
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 | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Verify formatting | |
| run: | | |
| fmt_out="$(gofmt -l .)" | |
| if [ -n "$fmt_out" ]; then | |
| echo "The following files need gofmt:" >&2 | |
| echo "$fmt_out" >&2 | |
| exit 1 | |
| fi | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Install go-licenses | |
| run: go install github.com/google/go-licenses/v2@v2.0.1 | |
| - name: Check dependency licenses | |
| run: go-licenses check ./cmd/voxclip --allowed_licenses=Apache-2.0,MIT,BSD-3-Clause,ISC | |
| - name: CLI help smoke test | |
| run: | | |
| go run ./cmd/voxclip --help | |
| go run ./cmd/voxclip setup --help | |
| go run ./cmd/voxclip record --help | |
| go run ./cmd/voxclip transcribe --help | |
| go run ./cmd/voxclip devices --help | |
| - name: Installer script syntax check | |
| run: | | |
| sh -n scripts/install-voxclip.sh | |
| ./scripts/install-voxclip.sh --help | |
| - name: Validate GoReleaser config | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| version: '~> v2' | |
| args: check | |
| env: | |
| HOMEBREW_TAP_TOKEN: placeholder | |
| unit-tests: | |
| needs: checks | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Unit tests | |
| run: go test ./... | |
| integration-tests: | |
| needs: unit-tests | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Integration-tag tests | |
| run: go test -tags=integration ./... | |
| e2e-tests: | |
| needs: integration-tests | |
| runs-on: ubuntu-latest | |
| env: | |
| WHISPER_REF: v1.8.3 | |
| VOXCLIP_E2E_MODEL: tiny | |
| VOXCLIP_E2E_MODEL_DIR: ${{ github.workspace }}/.cache/voxclip-models | |
| VOXCLIP_E2E_WHISPER_PATH: ${{ github.workspace }}/packaging/whisper/linux_amd64/whisper-cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Restore whisper-cli cache | |
| id: whisper-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: packaging/whisper/linux_amd64 | |
| key: whisper-${{ runner.os }}-${{ env.WHISPER_REF }}-${{ hashFiles('scripts/build-whisper-cli.sh') }} | |
| restore-keys: | | |
| whisper-${{ runner.os }}-${{ env.WHISPER_REF }}- | |
| - name: Build whisper-cli | |
| if: steps.whisper-cache.outputs.cache-hit != 'true' | |
| run: ./scripts/build-whisper-cli.sh --ref "${WHISPER_REF}" | |
| - name: Restore model cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.VOXCLIP_E2E_MODEL_DIR }} | |
| key: voxclip-model-${{ runner.os }}-${{ env.VOXCLIP_E2E_MODEL }}-${{ hashFiles('internal/whisper/model.go') }} | |
| restore-keys: | | |
| voxclip-model-${{ runner.os }}-${{ env.VOXCLIP_E2E_MODEL }}- | |
| - name: Warm tiny model cache | |
| run: | | |
| go run ./cmd/voxclip setup --model "${VOXCLIP_E2E_MODEL}" --model-dir "${VOXCLIP_E2E_MODEL_DIR}" --no-progress | |
| - name: End-to-end transcription tests | |
| run: | | |
| go test -tags=e2e ./internal/cli -count=1 | |
| mutation-tests: | |
| needs: unit-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Install gremlins | |
| run: go install github.com/go-gremlins/gremlins/cmd/gremlins@v0.6.0 | |
| - name: Run mutation tests | |
| run: gremlins unleash --threshold-efficacy 0.25 | |
| installer-tests: | |
| needs: checks | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install bats | |
| run: | | |
| if [[ "$RUNNER_OS" == "Linux" ]]; then | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq bats | |
| else | |
| brew install bats-core | |
| fi | |
| - name: Run installer tests | |
| run: bats scripts/install-voxclip_test.bats |