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