-
Notifications
You must be signed in to change notification settings - Fork 644
CI: Run tests via cargo-tarpaulin
#2951
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
cc @pietroalbini as I think you had some concerns about running 3rd party actions on CI. |
In general I'd prefer if we avoid using third-party actions, as those could be yet another avenue to inject malicious code into the build. |
can we make them first-party actions? |
If the issue is to use "the third party actions", we could use |
c642977
to
22319f3
Compare
Without using the external action this looks good on my side! |
unfortunately this still has two issues:
|
Hmm, I'm not sure at all.
So, in general, releases don't happen that often and it'd solve the issue to save the binary in the cache. |
cargo-tarpaulin
cargo-tarpaulin
@xd009642 any clue what might be the problem here? 🙏 |
oh sorry I realise I've neglected the issue my end. I remember when I tried it last I was struggling to get the backend tests working on fedora but I've got an ubuntu laptop here so I'll try again. I'll tag you on xd009642/tarpaulin#601 if I have any questions just to avoid filling up the PR comments 👍 |
Couple of comments on the PR from working on sorting the coverage issue in github actions:
|
looks like this is ready to go now! thanks again @xd009642 :) |
- name: Test | ||
- name: Install cargo-tarpaulin | ||
if: matrix.rust == 'stable' | ||
run: which cargo-tarpaulin || cargo install cargo-tarpaulin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workaround is still needed on CI? I think recent cargo doesn't require it anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It failed for me running the CI twice consecutively yesterday on my test project to debug the 0% coverage https://github.com/xd009642/crates-io-test/actions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that's interesting, I guess cargo recognizes it as an untracked file since it's introduced by cache (or another reason) 🤔. Thanks for clarifying, then I'm fine as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be reasonable to cache tarpaulin
? There is no need to rebuild it every CI run I feel?
https://github.com/marketplace/actions/cache#skipping-steps-based-on-cache-hit
https://github.com/actions/cache/blob/main/examples.md#rust---cargo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT
crates.io/.github/workflows/ci.yml
Lines 119 to 123 in 2b3bdf1
- name: Cache cargo binaries | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo/bin | |
key: ${{ runner.os }}-cargo-bin-${{ matrix.rust }}-${{ hashFiles('.diesel_version') }} |
diesel-cli
and cargo-tarpaulin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry then. Must have overlooked that part :/
04799d2
to
a8efed5
Compare
Having this flag is preventing tarpaulin from providing us with test coverage reports and I can't find any documented reason for why we would need this.
Alright, lets try this out on master and we'll see how well caching works on new PRs. @bors r+ |
📌 Commit 23bae68 has been approved by |
☀️ Test successful - checks-actions |
This PR adds https://github.com/actions-rs/tarpaulin to our CI pipeline to display a test coverage report.
Resolves #1162