Skip to content

ci: integrationtest: use magic nix cache #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/integrationtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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: "Cargo workspace"

# Run on every push (tag, branch) and pull_request
on: [pull_request, push, workflow_dispatch]

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@v3
- uses: cachix/install-nix-action@v20
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.05
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Set up cargo cache
uses: actions/cache@v3
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: cd integration-test && nix-shell --run "echo OK" && cd ..
# Now, run the actual test.
- run: cd integration-test && nix-shell --run ./run.sh && cd ..
34 changes: 0 additions & 34 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,40 +128,6 @@ jobs:
do-test: false
features: builder,unstable

integrationtest:
name: integrationtest
needs:
- build_nightly
- build_nostd_nightly
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
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.05
- name: Set up cargo cache
uses: actions/cache@v3
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: cd integration-test && nix-shell --run "echo OK" && cd ..
# Now, run the actual test.
- run: cd integration-test && nix-shell --run ./run.sh && cd ..

miri:
name: tests with miri (nightly)
needs: build_nightly
Expand Down
2 changes: 1 addition & 1 deletion integration-test/bins/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.