|
| 1 | +name: Developer Productivity |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + # Job to run change detection |
| 9 | + changes: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + # Set job outputs to values from filter step. |
| 12 | + outputs: |
| 13 | + nix-src: ${{ steps.filter.outputs.nix-src }} |
| 14 | + steps: |
| 15 | + - uses: dorny/paths-filter@v2 |
| 16 | + id: filter |
| 17 | + with: |
| 18 | + filters: | |
| 19 | + nix-src: |
| 20 | + - 'nix/**' |
| 21 | + - 'shell.nix' |
| 22 | +
|
| 23 | + # This is a convenience test to verify that the toolchain provided by |
| 24 | + # shell.nix is valid and can build + run the integration test. |
| 25 | + # |
| 26 | + # It only runs if the "nix-src" output of the "changes" job is true. |
| 27 | + nix_shell_toolchain: |
| 28 | + name: "Nix toolchain: cargo xtask run works" |
| 29 | + needs: changes |
| 30 | + if: ${{ needs.changes.outputs.nix-src == 'true' }} |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - name: Checkout sources |
| 34 | + uses: actions/checkout@v3 |
| 35 | + - uses: Swatinem/rust-cache@v2 |
| 36 | + - uses: cachix/install-nix-action@v20 |
| 37 | + with: |
| 38 | + # This channel is only required to invoke "nix-shell". |
| 39 | + # Everything inside that nix-shell will use a pinned version of nixpkgs. |
| 40 | + nix_path: nixpkgs=channel:nixos-23.05 |
| 41 | + # Dedicated step to separate all the |
| 42 | + # "copying path '/nix/store/...' from 'https://cache.nixos.org'." |
| 43 | + # messages from the actual build output. This job takes ~60secs. |
| 44 | + - name: Prepare Nix Store |
| 45 | + run: nix-shell --pure --run "cargo --version" |
| 46 | + - name: Run VM tests |
| 47 | + run: | |
| 48 | + COMMAND="cargo +stable xtask run --target x86_64 --headless --ci --tpm=v1" |
| 49 | + echo "Executing in nix shell now: $COMMAND" |
| 50 | + nix-shell --pure --run "$COMMAND" |
0 commit comments