This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run direct-minimal-versions tests on a weekly basis
My understanding is that it's okay that we don't use these minimal versions directly in our normal/committed Cargo.lock file, because we may want to pick up more recent compatible versions that have addressed security issues or improved performance, etc. That said, we still want to periodically test the minimal versions to ensure that our own project still compiles and runs as expected. This will help to increase compatibility across the whole Rust ecosystem when there are shared dependencies and someone is using our library. I've also abstracted out the CUE _testRust steps here, so they can be shared. See: - rust-lang/cargo#11688 - https://doc.rust-lang.org/beta/cargo/reference/unstable.html#minimal-versions - https://users.rust-lang.org/t/psa-please-specify-precise-dependency-versions-in-cargo-toml/71277 - https://twitter.com/jonhoo/status/1571290371124260865 - cue-lang/cue#860
- Loading branch information
1 parent
9c912b0
commit 0544c99
Showing
6 changed files
with
109 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package workflows | ||
|
||
scheduled: { | ||
name: "scheduled" | ||
|
||
on: { | ||
// Run every Monday at 7:45am UTC. | ||
schedule: [{cron: "45 7 * * 1"}] | ||
|
||
// Allow manually running this workflow. | ||
workflow_dispatch: null | ||
} | ||
|
||
concurrency: { | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
"cancel-in-progress": true | ||
} | ||
|
||
env: { | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_TERM_COLOR: "always" | ||
RUST_BACKTRACE: 1 | ||
RUSTFLAGS: "-D warnings" | ||
} | ||
|
||
jobs: direct_minimal_versions: { | ||
name: "direct-minimal-versions / stable" | ||
"runs-on": defaultRunner | ||
steps: [ | ||
_#checkoutCode & {with: ref: defaultBranch}, | ||
_#installRust, | ||
_#installRust & {with: toolchain: "nightly"}, | ||
{ | ||
name: "Default to stable Rust" | ||
run: "rustup default stable" | ||
}, | ||
{ | ||
name: "Resolve minimal dependency versions instead of maximum" | ||
run: "cargo +nightly update -Zdirect-minimal-versions" | ||
}, | ||
for step in _testRust {step}, | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This file is generated by .github/cue/ci_tool.cue; DO NOT EDIT! | ||
|
||
name: scheduled | ||
"on": | ||
schedule: | ||
- cron: 45 7 * * 1 | ||
workflow_dispatch: null | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_TERM_COLOR: always | ||
RUST_BACKTRACE: 1 | ||
RUSTFLAGS: -D warnings | ||
jobs: | ||
direct_minimal_versions: | ||
name: direct-minimal-versions / stable | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | ||
with: | ||
ref: main | ||
- name: Install stable Rust toolchain | ||
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d | ||
with: | ||
toolchain: stable | ||
- name: Install nightly Rust toolchain | ||
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d | ||
with: | ||
toolchain: nightly | ||
- name: Default to stable Rust | ||
run: rustup default stable | ||
- name: Resolve minimal dependency versions instead of maximum | ||
run: cargo +nightly update -Zdirect-minimal-versions | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@a775aaf2e8ed709f76ee019cb77e39fc50613631 | ||
with: | ||
tool: cargo-nextest | ||
- name: Compile tests | ||
run: cargo test --locked --no-run | ||
- name: Run tests | ||
run: cargo nextest run --locked --all-targets --all-features | ||
- name: Run doctests | ||
run: cargo test --locked --doc |