From 0de97d3819a24dc7d94de60b95c99c2c4e1620bb Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 24 Sep 2024 10:33:55 +0200 Subject: [PATCH] enhance workflow --- .github/workflows/rust.yml | 47 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b624997e..0b6b3a07 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,32 +1,27 @@ -name: Rust +name: CI -on: - push: - branches: ["master"] - pull_request: - branches: ["master"] - -env: - CARGO_TERM_COLOR: always +on: [push, pull_request] jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose + ci: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] - lint: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Lint - run: cargo clippy --verbose -- -D warnings + - name: Checkout code + uses: actions/checkout@v3 - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Test - run: cargo test --verbose + - name: cargo build + run: cargo build + + - name: cargo fmt + run: cargo fmt --all -- --check + + - name: cargo clippy + run: cargo clippy -- -D warnings + + - name: cargo test + run: cargo test