Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ jobs:
# Linux x86 gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
tool: cross
tool: cargo # report code coverage
extra-args: -F "plus"
coverage: true
- os: ubuntu-latest
target: i686-unknown-linux-gnu
tool: cross
Expand Down Expand Up @@ -283,13 +284,16 @@ jobs:
env:
CLASH_DOCKER_TEST: "true"

- name: Cargo test (docker test on linux, non BSD)
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Cargo test and coverage (docker test on linux, non BSD)
uses: clechasseur/rs-cargo@v3
if: ${{ startsWith(matrix.os, 'ubuntu') && !contains(matrix.target, 'freebsd') }}
with:
tool: ${{ matrix.tool }}
command: test
args: --workspace --exclude clash_ffi --target ${{ matrix.target }} ${{ matrix.extra-args }}
command: ${{ matrix.coverage && 'llvm-cov' || 'test' }}
args: --workspace --exclude clash_ffi --target ${{ matrix.target }} ${{ matrix.extra-args }} ${{ matrix.coverage && '--codecov --output-path codecov.json' || '' }}
env:
CROSS_CONTAINER_OPTS: "--network host"
CLASH_DOCKER_TEST: "true"
Expand All @@ -305,6 +309,14 @@ jobs:
env:
RUSTFLAGS: ${{ matrix.rustflags || '--cfg tokio_unstable' }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: ${{ !cancelled() && matrix.coverage }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true

- name: Cargo build
uses: clechasseur/rs-cargo@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ shell.nix

# macOS
.DS_Store

codecov.json
Loading