Skip to content

Add more CI coverage - #40

Merged
danobi merged 4 commits into
masterfrom
static_ci
Dec 17, 2023
Merged

Add more CI coverage#40
danobi merged 4 commits into
masterfrom
static_ci

Conversation

@danobi

@danobi danobi commented Dec 14, 2023

Copy link
Copy Markdown
Owner

Various small tweaks. See individual commits for more details.

@danobi
danobi force-pushed the static_ci branch 3 times, most recently from fd8fd71 to 749a4bd Compare December 14, 2023 17:40
@danobi
danobi marked this pull request as ready for review December 14, 2023 17:44
@danobi

danobi commented Dec 14, 2023

Copy link
Copy Markdown
Owner Author

cc @matklad

@matklad matklad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but couple of points about overall CI:

  • I usually cargo test --no-run rather than cargo build, to compile the tests as well
  • I think actions/checkout is at v3 these days? Not that it matters
  • If we want to check static linking, we might build against -musl rather than -gnu
  • That's highly controversial opinion, but I personally prefer cargo fmt to be triggered by cargo test, rather than by my CI, so that I can run cargo test local and not worry about some checks which are there on the CI but are missing locally. The same applies to static linking --- if I am worried about being able to statically link, I'd probably write an integration tests for this which shells out to cargo, rather than leaving this logic to a .yml in CI.
  • I like adding -Dwarnings to RUSTFLAGS on CI --- I don't mind warnings locally when I develop, but I'd rather CI not allowed me to merge them to master
  • default caching on CI is pretty bad, https://github.com/Swatinem/rust-cache/actions is a big improvement if you care about CI times.

@danobi
danobi force-pushed the static_ci branch 2 times, most recently from 87d1be1 to 52b296d Compare December 17, 2023 19:04
@danobi danobi mentioned this pull request Dec 17, 2023
@danobi

danobi commented Dec 17, 2023

Copy link
Copy Markdown
Owner Author

@matklad thanks for the tips! I added most of those suggestions to this pr. I filed a ticket to track the other two cuz I have various thoughts on that as well.

Nesting cargo calls for rustfmt is a neat trick -- I'll have to remember that. But for static build, it kinda requires a bit more setup like having musl-gcc wrapper script installed. I've done some similar "advanced" stuff for CI before and I found a nix based approach to be really awesome: https://dxuuu.xyz/bpftrace-nix.html

Higher signal from PR status overview
Before, it was only building non-test code and allowing warnings. Now,
we build test code as well as deny warnings.
@danobi
danobi merged commit c990820 into master Dec 17, 2023
@danobi
danobi deleted the static_ci branch December 25, 2023 20:05
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