-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
44 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,50 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
pull_request: master | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_TERM_COLOR: always | ||
FORMAT: true | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Format Rust | ||
run: cargo fmt --check | ||
|
||
- name: Format Shell | ||
run: | | ||
sudo apt-get install shfmt | ||
shfmt -i 4 -d . | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Lint Rust | ||
run: cargo clippy --verbose -- -D warnings | ||
|
||
- name: Lint Shell | ||
uses: ludeeus/action-shellcheck@2.0.0 | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
|
||
- name: Test with coverage | ||
run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: codecov.json | ||
fail_ci_if_error: true | ||
format: | ||
env: | ||
FORMAT_SHELL: true | ||
|
||
if: {{env.FORMAT}} | ||
runs_on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: cargo fmt --check | ||
- run: sudo apt-get install shfmt; shfmt -i 4 -d . | ||
if: {{env.FORMAT_SHELL}} | ||
lint: | ||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
needs: [format] | ||
runs_on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ludeeus/action-shellcheck@2.0.0 | ||
- run: cargo clippy --verbose -- -D warnings | ||
|
||
test: | ||
|
||
needs: [lint] | ||
runs_on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: taiki-e/install-action@cargo-llvm-cov | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
files: codecov.json | ||
fail_ci_if_error: true | ||
- run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json |