on:
pull_request:
push:
branches:
- master
name: Continuous integration
jobs:
analyze:
name: Dusk Analyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: install
args: --git https://github.com/dusk-network/cargo-dusk-analyzer
- uses: actions-rs/cargo@v1
with:
command: dusk-analyzer
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install kcov
run: sudo apt install -y kcov
- name: Build test executables
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '-Cinline-threshold=0 -Clink-dead-code'
RUSTDOCFLAGS: '-Cinline-threshold=0 -Clink-dead-code'
with:
command: test
args: --all-features --no-run
- name: Test with kcov
run: >
find target/debug/deps -type f -executable ! -name "*.*" |
xargs -n1 kcov --exclude-pattern=/.cargo,/usr/lib,/target,/tests --verify target/cov
- name: Upload coverage
uses: codecov/codecov-action@v1.0.2
with:
token: ${{secrets.CODECOV_TOKEN}}
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- name: Run `cargo clippy`
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings