integrationtest.yml 2.1 KB

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