Skip to content

Commit d7a7d75

Browse files
committed
ci: run cargo xtask in Nix shell
This simplifies to get all the relevant tools.
1 parent 7d4074b commit d7a7d75

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/developer_productivity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Checkout sources
3535
uses: actions/checkout@v4
3636
- uses: Swatinem/rust-cache@v2
37-
- uses: cachix/install-nix-action@v30
37+
- uses: cachix/install-nix-action@v31
3838
# Dedicated step to separate all the
3939
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
4040
# messages from the actual build output.

.github/workflows/rust.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,19 @@ jobs:
8787
steps:
8888
- name: Checkout sources
8989
uses: actions/checkout@v4
90+
- uses: cachix/install-nix-action@v31
9091
- uses: Swatinem/rust-cache@v2
91-
- name: Install yamlfmt
92-
env:
93-
YFV: "0.13.0"
94-
HASH: "043e96d754a8afa4f4c5c13ffb2f3e50c6be5a70bf53292d3025abc0b42fe4ae"
95-
run: |
96-
curl -L --fail --output /tmp/yamlfmt.tar.xz https://github.com/google/yamlfmt/releases/download/v${YFV}/yamlfmt_${YFV}_Linux_x86_64.tar.gz
97-
echo "${HASH} /tmp/yamlfmt.tar.xz" | sha256sum --check
98-
tar xf /tmp/yamlfmt.tar.xz -C /usr/local/bin yamlfmt
92+
# Dedicated step to separate all the
93+
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
94+
# messages from the actual build output.
95+
- name: Prepare Nix Store
96+
run: nix develop --command echo
97+
# Executing this in a Nix shell ensures that all our checks run as all
98+
# required tooling exists.
9999
- name: Check formatting
100-
run: cargo xtask fmt --check
100+
run: |
101+
CMD="cargo xtask fmt --check"
102+
nix develop --command bash -c "$CMD"
101103
- name: Run clippy
102104
run: |
103105
rustup component add clippy

0 commit comments

Comments
 (0)