Skip to content
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

Improve CI, requring all feature combos to succeed along with clippy #321

Merged
merged 13 commits into from
Sep 10, 2023

Conversation

Techcable
Copy link
Member

@Techcable Techcable commented Sep 6, 2023

Significantly cleanup & improve our CI setup.

This requires clippy lints to succeed across two hardcoded versions (MSRV and something recent).
It also requires all feature combinations to pass the tests (with an exception for nested-values on MSRV).

Big Changes

  • ci: Require clippy lints to succeed without warnings
    • Fix miscelaneous clippy lints
  • ci: Require successful test execution for all feature combos.
    • On Minimum Supported Rust, allow nested-values tests to fail.
      This is needed because the erased-serde dependency requires edition="2021", added in Rust 1.56
    • dynamic-keys: Remove duplicate impl of AsRef for Key

Minor Changes

  • ci: Split version & feature matrix across multiple lines
    • Ensures diff is minimal
  • ci: Update github actions toolchains, avoiding deprecation warnings
  • ci: Add 'stable minus 15 releases' to the testing matix
    • Per the official policy on the wiki, this is an upper bound on the MSRV
    • Possible because of switch to dtolnay/rust-toolchain
  • ci: Enable the --all-targets flag for tests, check, and clippy
  • Setup a clippy configuration file
  • README.md: Correct the Minimum Supported Rust Version to 1.48

Make sure to:

  • Add an entry to CHANGELOG.md (if necessary)

Also fix new lint `noop_method_call`,
which is present on the latest
nightly compiler (rustc 1.74.0-nightly 2023-08-29)
I can't believe our CI hasn't caught this compilation error earlier.
Clarifies things & will reduce diff for future changes.
Unfortunately, it appears that actions-rs/toolchains is unmaintained.
Switch to dtolnay/rust-toolchain which appears to be the new de-facto standard.
This version is important, because the wiki says it places an
upper bound on the Minimum Supported Rust Version.
In other words, it is the highest rust version we can use as MSRV.

This new syntax is made possible by the switch to dtolnay/rust-toolchain.
This is only required for MSRV and hardcoded rust versions.
It is possible that an upgrade to stable rust will introduce warnings
that would break existing code.

For this reason, we hardcode a recent version of stable rust
to run clippy on in addition to the MSRV, stable, and nightly.
Before, we only required tests to succeed on the default features.
This was necessary because we had CI disabled for a long time
when Travis CI got rid of their free plans.
It took us a while to switch to Github Actions and by then
some code had broken on special feature combinations.

Now, we require all code to pass tests by default.
We can grant specific exceptions on a case-by-case basis.
In particular, this may be needed for the Minimum Supported Rust Version.
The is because recent versions of erased-serde
require edition="2021" which was stablized in 1.56.

TODO: Add back testing suport for all feature combinations on MSRV.
Should be possible once we bump MSRV to 1.56 (about two years old I think?)

Could also consider adding cirrus-ci as a secondary CI
since they have support for complex starlark configuration instead of YAML.
@Techcable Techcable force-pushed the fixup/2023-09-03/clippy branch 2 times, most recently from d3dd4c0 to f4d184b Compare September 6, 2023 15:51
This is the first version that supports edition="2021".
It is a major release, and appears to be the earliest version
that our (optional) dependency `erased-serde` supports.
Fix clippy lints for these example targets & test code.
This requires including the Minimum Supported Rust Version (MSRV).

Additionally, document in Cargo.toml the different places
where the MSRV needs to be kept in sync.
@Techcable Techcable force-pushed the fixup/2023-09-03/clippy branch from f4d184b to 798a6ba Compare September 6, 2023 15:52
@Techcable Techcable requested a review from dpc September 6, 2023 15:57
@Techcable
Copy link
Member Author

Hi @dpc , now that it is the weekend, could you maybe review this? 😃

Copy link
Collaborator

@dpc dpc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it. :)

@Techcable Techcable merged commit 141d90b into master Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants