Skip to content

Commit

Permalink
update workflows, include cargo audit, code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
abhemanyus committed Oct 11, 2024
1 parent acd1a6d commit da1a8c8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 53 deletions.
74 changes: 41 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@
name: Continous integration
name: Rust

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
build:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Cargo
id: cache-cargo
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo
- name: Check
run: cargo check
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Build release
run: cargo build --release
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test

lints:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Cargo
id: cache-cargo
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo
- name: Formatting
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace -- -D warnings
- name: Documentation
run: cargo doc --no-deps --workspace --document-private-items
env:
RUSTDOCFLAGS: -D warnings
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Enforce formatting
run: cargo fmt --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Linting
run: cargo clippy -- -D warnings

coverage:
name: Code coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate code coverage
run: |
cargo tarpaulin --verbose --workspace
20 changes: 0 additions & 20 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit da1a8c8

Please # to comment.