Skip to content

Commit 077dc1e

Browse files
committed
ci: integrationtest: use magic nix cache
1 parent 557a681 commit 077dc1e

File tree

3 files changed

+52
-35
lines changed

3 files changed

+52
-35
lines changed

.github/workflows/integrationtest.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# CI for the whole Cargo workspace. Although having two relatively independent
2+
# crates in this workspace (as they do not get released together, as for example
3+
# tokio with its sub crates), a PR for a certain CI may report errors in the
4+
# other workspace members. I think this is unfortunate. I've experimented with
5+
# CI runs per workspace member but the complexity in the end was not worth it.
6+
# Instead, it is the right thing that the CI always covers the whole repository
7+
# and that it is as stable as possible.
8+
9+
name: "Cargo workspace"
10+
11+
# Run on every push (tag, branch) and pull_request
12+
on: [pull_request, push, workflow_dispatch]
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
integrationtest:
19+
name: integrationtest
20+
needs:
21+
- build_nightly
22+
- build_nostd_nightly
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check out
26+
uses: actions/checkout@v3
27+
- uses: cachix/install-nix-action@v20
28+
with:
29+
# This channel is only required to invoke "nix-shell".
30+
# Everything inside that nix-shell will use a pinned version of
31+
# nixpkgs.
32+
nix_path: nixpkgs=channel:nixos-23.05
33+
- uses: DeterminateSystems/magic-nix-cache-action@main
34+
- name: Set up cargo cache
35+
uses: actions/cache@v3
36+
continue-on-error: false
37+
with:
38+
path: |
39+
~/.cargo/bin/
40+
~/.cargo/registry/index/
41+
~/.cargo/registry/cache/
42+
~/.cargo/git/db/
43+
integration-test/bins/target/
44+
# Hash over Cargo.toml and Cargo.lock, as this might be copied to
45+
# projects that do not have a Cargo.lock in their repository tree!
46+
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
47+
# Have all the "copying into Nix store" messages in a dedicated step for
48+
# better log visibility.
49+
- run: cd integration-test && nix-shell --run "echo OK" && cd ..
50+
# Now, run the actual test.
51+
- run: cd integration-test && nix-shell --run ./run.sh && cd ..

.github/workflows/rust.yml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -128,40 +128,6 @@ jobs:
128128
do-test: false
129129
features: builder,unstable
130130

131-
integrationtest:
132-
name: integrationtest
133-
needs:
134-
- build_nightly
135-
- build_nostd_nightly
136-
runs-on: ubuntu-latest
137-
steps:
138-
- name: Check out
139-
uses: actions/checkout@v3
140-
- uses: cachix/install-nix-action@v20
141-
with:
142-
# This channel is only required to invoke "nix-shell".
143-
# Everything inside that nix-shell will use a pinned version of
144-
# nixpkgs.
145-
nix_path: nixpkgs=channel:nixos-23.05
146-
- name: Set up cargo cache
147-
uses: actions/cache@v3
148-
continue-on-error: false
149-
with:
150-
path: |
151-
~/.cargo/bin/
152-
~/.cargo/registry/index/
153-
~/.cargo/registry/cache/
154-
~/.cargo/git/db/
155-
integration-test/bins/target/
156-
# Hash over Cargo.toml and Cargo.lock, as this might be copied to
157-
# projects that do not have a Cargo.lock in their repository tree!
158-
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
159-
# Have all the "copying into Nix store" messages in a dedicated step for
160-
# better log visibility.
161-
- run: cd integration-test && nix-shell --run "echo OK" && cd ..
162-
# Now, run the actual test.
163-
- run: cd integration-test && nix-shell --run ./run.sh && cd ..
164-
165131
miri:
166132
name: tests with miri (nightly)
167133
needs: build_nightly

integration-test/bins/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)