-
Notifications
You must be signed in to change notification settings - Fork 606
rework github actions for code coverage #186
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
739a8a9
rework github actions for code coverage
maxcountryman ea1b930
use --all-features for clippy and test
maxcountryman a199d5c
mirror travis config for clippy and test
maxcountryman d126b18
use canonical clippy invocation
maxcountryman 01f0abb
check all targets and all features
maxcountryman a54b981
remove upstream jobs for test
maxcountryman ec83b8d
document nightly requirement for fmt
maxcountryman a213095
more consistent comment formatting
maxcountryman a3f4e9e
subscribe to pull_request
maxcountryman 41221c9
use install action to provide tarpaulin
maxcountryman 36275e1
fixup yaml
maxcountryman 55c90b3
fixup typo
maxcountryman 8ef50c6
use coveralls action
maxcountryman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,30 +1,65 @@ | ||
name: Rust | ||
|
||
on: [push] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
codestyle: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: rustfmt | ||
# Note that `nightly` is required for `license_template_path`, as | ||
# it's an unstable feature. | ||
rust-version: nightly | ||
- uses: actions/checkout@v2 | ||
- run: cargo fmt -- --check --config-path <(echo 'license_template_path = "HEADER"') | ||
|
||
lint: | ||
maxcountryman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: clippy | ||
- uses: actions/checkout@v2 | ||
- run: cargo clippy --all-targets --all-features -- -D warnings | ||
|
||
compile: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
- uses: actions/checkout@master | ||
- run: cargo check --all-targets --all-features | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
rust: [stable, beta, nightly] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup Rust | ||
run: | | ||
rustup toolchain install nightly --profile default | ||
rustup toolchain install stable | ||
rustup override set stable | ||
# Clippy must be run first, as its lints are only triggered during | ||
# compilation. Put another way: after a successful `cargo build`, `cargo | ||
# clippy` is guaranteed to produce no results. This bug is known upstream: | ||
# https://github.com/rust-lang/rust-clippy/issues/2604. | ||
# - name: Clippy | ||
# run: cargo clippy -- --all-targets --all-features -- -D warnings | ||
- name: Check formatting | ||
run: | | ||
cargo +nightly fmt -- --check --config-path <(echo 'license_template_path = "HEADER"') | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
- name: Run tests for all features | ||
run: cargo test --verbose -- all-features | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: ${{ matrix.rust }} | ||
- name: Install Tarpaulin | ||
uses: actions-rs/[email protected] | ||
with: | ||
crate: cargo-tarpaulin | ||
version: 0.13.3 | ||
use-tool-cache: true | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Test | ||
run: cargo test --all-features | ||
- name: Coverage | ||
if: matrix.rust == 'stable' | ||
run: cargo tarpaulin -o Lcov --output-dir ./coverage | ||
- name: Coveralls | ||
if: matrix.rust == 'stable' | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I just noticed this does not use
cargo +nightly fmt
, making it print aWarning: can't set
license_template_path = "HEADER", unstable features are only available in nightly channel.
and presumably not run that check.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.
Oh no, definitely an oversight on my part. Should be a trivial fix.