-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
a3b0f4d
commit ae22ae2
Showing
3 changed files
with
104 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "src/**" | ||
- "tests/**" | ||
- "scripts/**" | ||
- "proto/**" | ||
|
||
|
||
name: Coverage | ||
|
||
jobs: | ||
check: | ||
name: Rust project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install Prerequisites | ||
run: sh ./install.sh | ||
|
||
- name: Run cargo-tarpaulin | ||
uses: actions-rs/[email protected] | ||
with: | ||
version: '0.19.1' | ||
args: '-- --test-threads 1' | ||
|
||
- name: Upload to codecov.io | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
|
||
- name: Archive code coverage results | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: code-coverage-report | ||
path: cobertura.xml |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: fmt | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "src/**" | ||
- "tests/**" | ||
- "scripts/**" | ||
- "proto/**" | ||
pull_request: | ||
types: [ opened, synchronize ] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
fmt: | ||
runs-on: ubuntu-22.04 | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Prerequisites | ||
run: sh ./install.sh | ||
|
||
- name: add path | ||
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
|
||
- name: Run fmt check | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run clippy | ||
run: cargo clippy --all-targets --all-features -- -D warnings | ||
|
||
- name: Check function complexity | ||
run: python3 -m lizard -l rust src/* -L 300 -a 10 | ||
|
||
- name: proto lint | ||
run: cd proto && prototool lint . --config-data '{"lint":{"group":"google"}}' | ||
|
||
- name: python lint | ||
run: cd scripts && python3 -m pylint --rcfile=.pylintrc *.py | tee | grep 10.00 |
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