-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
927f7b3
commit f207773
Showing
4 changed files
with
94 additions
and
95 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
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,62 @@ | ||
name: generate_coverage | ||
|
||
on: | ||
workflow_call | ||
|
||
jobs: | ||
grcov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Taskwarrior | ||
uses: ./.github/actions/install-taskwarrior | ||
with: | ||
secret_gh_token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
# prepare taskwarrior, initial setup | ||
task rc.confirmation=off || echo 0 | ||
- name: Install Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
components: llvm-tools-preview | ||
- name: Checkout testdata | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: kdheepak/taskwarrior-testdata | ||
path: taskwarrior-testdata | ||
- name: Build taskwarrior-tui with coverage | ||
uses: clechasseur/rs-cargo@v2 | ||
with: | ||
command: build | ||
env: | ||
RUSTFLAGS: "-Cinstrument-coverage" | ||
- name: Run taskwarrior-tui tests in coverage environment | ||
uses: clechasseur/rs-cargo@v2 | ||
with: | ||
command: test | ||
args: --workspace -- --nocapture | ||
env: | ||
TASKRC: taskwarrior-testdata/.taskrc | ||
TASKDATA: taskwarrior-testdata/.task | ||
RUST_BACKTRACE: full | ||
RUSTFLAGS: "-Cinstrument-coverage" | ||
LLVM_PROFILE_FILE: "your_name-%p-%m.profraw" | ||
|
||
- name: Install grcov | ||
uses: clechasseur/rs-cargo@v2 | ||
with: | ||
command: install | ||
args: grcov | ||
- name: Gather coverage data | ||
run: | | ||
mkdir ./target/debug/coverage/ | ||
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage/ | ||
shell: bash | ||
- name: Coveralls upload | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./target/debug/coverage/lcov |