Skip to content

Commit

Permalink
Adding auto running lints to make sure code is correctly formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
nuno1212s committed Mar 24, 2024
1 parent 3cad3b8 commit cbc4efa
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/lint_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

name: lint code
on:
pull_request:
push:
# Sequence of patterns matched against refs/heads
branches:
- 'main'
- 'research/**'
- 'releases/**'
jobs:
lint:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
- run: |
rustup --version
rustup show
cargo --version
cargo fmt --version
cargo clippy --version
- run: cargo fmt --all -- --check
- run: cargo clippy --locked --workspace --all-targets -- --no-deps

unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
env:
# Shrink artifact size by not including debug info. Makes build faster and shrinks cache.
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_PROFILE_TEST_DEBUG: 0
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- run: cargo build --tests
- run: cargo nextest run

0 comments on commit cbc4efa

Please sign in to comment.