integrationtest.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. name: "Integration Test"
  9. # Run on every push (tag, branch) and pull_request
  10. on: [ pull_request, push, merge_group ]
  11. env:
  12. CARGO_TERM_COLOR: always
  13. jobs:
  14. integrationtest:
  15. name: integrationtest
  16. # No "needs" to make CI faster.
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Check out
  20. uses: actions/checkout@v4
  21. - uses: cachix/install-nix-action@V27
  22. with:
  23. # This channel is only required to invoke "nix-shell".
  24. # Everything inside that nix-shell will use a pinned version of
  25. # nixpkgs.
  26. nix_path: nixpkgs=channel:nixos-23.11
  27. - uses: DeterminateSystems/magic-nix-cache-action@main
  28. - name: Set up cargo cache
  29. uses: actions/cache@v4
  30. continue-on-error: false
  31. with:
  32. path: |
  33. ~/.cargo/bin/
  34. ~/.cargo/registry/index/
  35. ~/.cargo/registry/cache/
  36. ~/.cargo/git/db/
  37. integration-test/bins/target/
  38. # Hash over Cargo.toml and Cargo.lock, as this might be copied to
  39. # projects that do not have a Cargo.lock in their repository tree!
  40. key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
  41. # Have all the "copying into Nix store" messages in a dedicated step for
  42. # better log visibility.
  43. - run: nix-shell --run "echo OK"
  44. # Now, run the actual test.
  45. - run: nix-shell --run run-integrationtest