Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linting Workflow #12

Merged
merged 6 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: Security audit
name: audit

on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/audit.yml'

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-deny
- name: Scan for vulnerabilities
run: cargo deny check advisories
run: cargo deny check advisories
53 changes: 0 additions & 53 deletions .github/workflows/general.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: linting

on:
push:
branches:
- 'main'
paths:
- 'src/**/*'
- 'tests/**/*'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.rustfmt.toml'
- '.github/workflows/linting.yml'
pull_request:
branches:
- 'main'
paths:
- 'src/**/*'
- 'tests/**/*'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.rustfmt.toml'
- '.github/workflows/linting.yml'

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Linting
run: cargo clippy -- -D warnings
50 changes: 50 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: testing

on:
push:
branches:
- 'main'
paths:
- 'src/**/*'
- 'tests/**/*'
- '**/Cargo.toml'
- '**/Cargo.lock'
- 'docker-compose.yml'
- '.github/workflows/testing.yml'
pull_request:
branches:
- 'main'
paths:
- 'src/**/*'
- 'tests/**/*'
- '**/Cargo.toml'
- '**/Cargo.lock'
- 'docker-compose.yml'
- '.github/workflows/testing.yml'

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test

coverage:
name: Code coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate code coverage
run: |
cargo tarpaulin --verbose --workspace
1 change: 0 additions & 1 deletion benches/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern crate test;

#[macro_use]
// mod macros;

use test::Bencher;

// #[derive(Debug, PartialEq, RustcEncodable, RustcDecodable, Serialize, Deserialize)]
Expand Down
Loading