Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 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
77 changes: 38 additions & 39 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Coverage

on:
push:
tags: ["v*"]
branches: ["master"]
tags: [ "v*" ]
branches: [ "master" ]
pull_request:
branches: ["master"]
branches: [ "master" ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -16,43 +16,42 @@ jobs:
name: Coverage
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: coverage-${{ hashFiles('**/Cargo.toml') }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: coverage-${{ hashFiles('**/Cargo.toml') }}

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cargo test and coverage
uses: clechasseur/rs-cargo@v3
with:
tool: cross
command: 'llvm-cov'
args: --workspace --exclude clash_ffi -F "plus" --codecov --output-path codecov.json
env:
CROSS_CONTAINER_OPTS: "--network host"
CLASH_DOCKER_TEST: 'true'
- name: Cargo test and coverage
uses: clechasseur/rs-cargo@v3
with:
tool: cross
command: 'llvm-cov'
args: --workspace --exclude clash_ffi -F "plus" --codecov --output-path codecov.json
env:
CROSS_CONTAINER_OPTS: "--network host"
CLASH_DOCKER_TEST: 'true'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
143 changes: 4 additions & 139 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion clash/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ fn main() {
log_file: cli.log_file,
}) {
Ok(_) => {}
Err(_) => {
Err(e) => {
eprintln!("Failed to start clash: {}", e);
exit(1);
}
}
Expand Down
Loading
Loading