Skip to content

Commit 3292fa9

Browse files
xi xiaoxixiaofinland
authored andcommitted
ci: add test coverage artifact
1 parent 25f8661 commit 3292fa9

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

.github/workflows/pr-ci-merge-main.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,41 +49,46 @@ jobs:
4949
with:
5050
components: clippy, rustfmt
5151

52-
# Combine security tools installation
53-
- name: Install Security Tools
54-
run: |
55-
cargo install cargo-audit cargo-deny --locked
56-
5752
# Group formatting and linting checks
5853
- name: Code Quality Checks
5954
run: |
6055
cargo fmt -- --check
6156
cargo clippy --all-targets --all-features -- -D warnings
6257
58+
- name: Install cargo-tarpaulin
59+
uses: baptiste0928/cargo-install@v3
60+
with:
61+
crate: cargo-tarpaulin
62+
6363
# Run tests with coverage
6464
- name: Run Tests
6565
run: |
66-
cargo install cargo-tarpaulin
67-
cargo tarpaulin --out Xml
66+
cargo tarpaulin --out Xml --output-dir coverage.xml
6867
69-
# Add test coverage reporting
70-
- name: Upload Coverage
68+
# Upload test result as artifact
69+
- name: Upload Coverage Report
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: coverage-report
73+
path: coverage.xml
74+
75+
- name: Upload Coverage to Codev
7176
uses: codecov/codecov-action@v5
7277
with:
7378
token: ${{ secrets.CODECOV_TOKEN }}
7479

80+
- name: Install cargo-audit
81+
uses: baptiste0928/cargo-install@v3
82+
with:
83+
crate: cargo-audit
84+
85+
- name: Install cargo-deny
86+
uses: baptiste0928/cargo-install@v3
87+
with:
88+
crate: cargo-deny
89+
7590
# Group security checks
7691
- name: Security Audit
7792
run: |
7893
cargo audit --stale
7994
cargo deny check
80-
81-
# Add caching for installed tools
82-
- name: C2w3e456 ache Tools
83-
uses: actions/cache@v3
84-
with:
85-
path: |
86-
~/.cargo/bin/cargo-audit
87-
~/.cargo/bin/cargo-deny
88-
~/.cargo/bin/cargo-tarpaulin
89-
key: ${{ runner.os }}-cargo-tools-${{ hashFiles('**/Cargo.lock') }}

0 commit comments

Comments
 (0)