Skip to content

Commit

Permalink
feat: updated the github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-cne committed Apr 12, 2024
1 parent 3391089 commit fcca530
Showing 1 changed file with 73 additions and 19 deletions.
92 changes: 73 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
name: Lint, Build & Test
name: fmt, lint & build

on: push

env:
CARGO_TERM_COLOR: always
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
cache:
runs-on: ubuntu-latest
name: CI
name: Setup
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v3
uses: actions/cache@v4
continue-on-error: false
with:
path: |
Expand All @@ -31,15 +34,66 @@ jobs:
rustc --version
cargo clippy --version
- name: Lint
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
fmt:
runs-on: ubuntu-latest
name: Codestyle
needs: cache
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: fmt
run: cargo fmt --all -- --check

- name: Build
run: cargo build --verbose --release
clippy:
runs-on: ubuntu-latest
name: clippy
needs: cache
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: clippy
run: cargo clippy -- -D warnings

- name: Run tests
run: |
cargo check
cargo test --verbose --all
build:
runs-on: ubuntu-latest
name: build
needs: cache
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: build
run: cargo check --workspace --release --all-features

0 comments on commit fcca530

Please sign in to comment.