Skip to content

Commit 2e91f50

Browse files
committed
github: Run the tests with the latest dependencies
Always check if the tests run with the latest dependencies, to detect breaking changes early. The reason we need to run `cargo update` to do so is because we commit Cargo.lock, since we are a both a library and binary crate [1]. By committing Cargo.lock, our binaries are guaranteed to build reproducibly and have the same behavior, but the tests will always run against the pinned dependencies. This way, a breaking change in a dependency may go unnoticed, even in a new environment. So, we need to run `cargo update` to essentially ignore Cargo.lock. Note that we do this solely for the tests, and nowhere else in the CI pipeline. This means that Cargo.lock is still used to produce the binaries, so that they match the binaries that `cargo build` from source would produce. [1]: https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
1 parent b4780d3 commit 2e91f50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/CI.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ jobs:
8383
toolchain: ${{ matrix.rust }}
8484
override: true
8585

86+
# Catch any breaking changes in the dependencies early, by always updating
87+
# them before running the tests.
88+
- name: Update dependencies
89+
uses: actions-rs/cargo@v1
90+
with:
91+
command: update
92+
8693
- name: Test
8794
uses: actions-rs/cargo@v1
8895
with:

0 commit comments

Comments
 (0)