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