Skip to content

Commit 01ed659

Browse files
committed
Add coverage for rust
1 parent b068bdb commit 01ed659

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/build-rust.yml

+32
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,35 @@ jobs:
5555
cargo run ${{matrix.type}} >> out
5656
echo '```' >> out
5757
cat out >> "$GITHUB_STEP_SUMMARY"
58+
coverage:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
- name: Get private repo
64+
uses: actions/checkout@v4
65+
with:
66+
repository: alien11689/advent-of-code
67+
ref: master
68+
token: ${{ secrets.ADVENT_OF_CODE_PAT}}
69+
path: private
70+
- name: Get files
71+
run: |
72+
mkdir -p rust-aoc/resources/2015 rust-aoc/resources/2023 rust-aoc/resources/2024
73+
cp -r private/2015/src/main/resources/* rust-aoc/resources/2015
74+
cp -r private/2023/src/main/resources/* rust-aoc/resources/2023
75+
cp -r private/2024/src/main/resources/* rust-aoc/resources/2024
76+
- name: Rust update
77+
run: rustup update
78+
- name: Install coverage tool
79+
run: cargo install cargo-tarpaulin
80+
- name: Gather coverage
81+
run: |
82+
cd rust-aoc
83+
cargo tarpaulin -o Lcov
84+
- name: Upload coverage
85+
uses: codecov/codecov-action@v3
86+
with:
87+
fail_ci_if_error: true
88+
files: rust-aoc/lcov.info
89+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)