-
Notifications
You must be signed in to change notification settings - Fork 56
53 lines (48 loc) · 2.12 KB
/
integrationtest.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
51
52
53
# CI for the whole Cargo workspace. Although having two relatively independent
# crates in this workspace (as they do not get released together, as for example
# tokio with its sub crates), a PR for a certain CI may report errors in the
# other workspace members. I think this is unfortunate. I've experimented with
# CI runs per workspace member but the complexity in the end was not worth it.
# Instead, it is the right thing that the CI always covers the whole repository
# and that it is as stable as possible.
name: "Integration Test"
# Run on every push (tag, branch) and pull_request
on: [ pull_request, push, merge_group ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
integrationtest:
name: integrationtest
# No "needs" to make CI faster.
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- 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:nixos-23.11
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Set up cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
integration-test/bins/target/
# Hash over Cargo.toml and Cargo.lock, as this might be copied to
# projects that do not have a Cargo.lock in their repository tree!
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
# Have all the "copying into Nix store" messages in a dedicated step for
# better log visibility.
- run: nix-shell --run "echo OK"
# Now, run the actual test.
- run: nix-shell --run run-integrationtest