chore: Prepare for release #6
Workflow file for this run
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
name: datta | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
clippy-rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: clippy, rustfmt | |
- name: Run rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -- --check --verbose | |
- name: Run cargo clippy | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-targets --tests --benches -- -D warnings | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Build | |
run: cargo build --verbose --tests --benches | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Generate docs | |
run: cargo doc --no-deps | |
code-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install grcov | |
env: | |
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download | |
GRCOV_VERSION: v0.8.7 | |
run: | | |
curl -L "$GRCOV_LINK/$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" | | |
tar xj -C $HOME/.cargo/bin | |
- name: Install llvm-tools-preview | |
run: | | |
rustup component add llvm-tools-preview | |
# Not necessary on a newly created image, but strictly advised | |
- name: Run cargo clean | |
run: | | |
cargo clean | |
- name: Run tests | |
env: | |
CARGO_INCREMENTAL: 0 | |
LLVM_PROFILE_FILE: "datta-%p-%m.profraw" | |
RUSTFLAGS: > | |
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code | |
-Coverflow-checks=off | |
RUSTDOCFLAGS: > | |
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code | |
-Coverflow-checks=off | |
run: | | |
cargo test --verbose | |
- name: Get coverage data for codecov | |
run: | | |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \ | |
--ignore-not-existing --ignore "/*" --ignore "../*" -o lcov.info | |
- name: Codecov upload | |
uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
dependency-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
- name: Install cargo-udeps | |
env: | |
UDEPS_LINK: https://github.com/est31/cargo-udeps/releases/download | |
UDEPS_VERSION: v0.1.45 | |
run: | | |
curl -L "$UDEPS_LINK/$UDEPS_VERSION/cargo-udeps-$UDEPS_VERSION-x86_64-unknown-linux-gnu.tar.gz" | | |
tar xz -C $HOME/.cargo/bin --strip-components 2 | |
- name: Install cargo-deny | |
env: | |
DENY_LINK: https://github.com/EmbarkStudios/cargo-deny/releases/download | |
DENY_VERSION: 0.14.15 | |
run: | | |
curl -L "$DENY_LINK/$DENY_VERSION/cargo-deny-$DENY_VERSION-x86_64-unknown-linux-musl.tar.gz" | | |
tar xz -C $HOME/.cargo/bin --strip-components 1 | |
- name: Install cargo-audit | |
env: | |
AUDIT_LINK: https://github.com/rustsec/rustsec/releases/download/cargo-audit%2F | |
AUDIT_VERSION: v0.20.0 | |
run: | | |
curl -L "$AUDIT_LINK$AUDIT_VERSION/cargo-audit-x86_64-unknown-linux-musl-$AUDIT_VERSION.tgz" | | |
tar xzv -C $HOME/.cargo/bin --strip-components 1 | |
- name: Run cargo-udeps | |
run: | | |
cargo +nightly udeps --all-targets | |
- name: Run cargo-deny | |
run: | | |
cargo deny init | |
cargo deny check bans | |
# cargo deny check licenses | |
- name: Run cargo-audit | |
run: | | |
cargo audit |