name: CI # pull_request is unfiltered: stacked PRs (based on other feature branches) # must run CI too. on: push: branches: [master, main] pull_request: workflow_dispatch: jobs: test: # ATTIC_TOKEN_PUBLIC only exists in the public-cache environment; master # jobs must opt into it to publish to the public cache. environment: ${{ github.ref == 'refs/heads/master' && 'public-cache' || '' }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: - uses: actions/checkout@v4 - uses: logos-co/setup-nix-cache-action@v1 with: attic-token-ci: ${{ secrets.ATTIC_TOKEN_CI }} attic-token-public: ${{ secrets.ATTIC_TOKEN_PUBLIC }} # `nix build '.#tests'` below builds the PACKAGE; it does not reach the # `checks` attrset at all. Every check therefore needs a step of its own # here — a check nothing runs is indistinguishable from a check that # passes, which is the exact failure this particular check exists to # prevent. (`ws test` is no substitute: it evaluates only ONE check per # repo.) currentSystem rather than a literal, so the same line is right on # both matrix runners. - name: Module-impl ABI manifest run: | nix build ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem).module-impl-abi-tests" \ --no-link --print-build-logs - name: Build tests run: nix build '.#tests' - name: Run protocol tests run: ./result/bin/protocol_tests env: QT_QPA_PLATFORM: offscreen # The Qt-loop-free half, in its own process because that is the whole # point: QCoreApplication is a process-wide singleton and protocol_tests # constructs one before its first test, so no test in that binary can # reach the state a Qt-free host is permanently in. - name: Run protocol tests (no Qt event loop) run: ./result/bin/protocol_noqt_tests