Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
arnodb committed Sep 28, 2023
1 parent 9e0741b commit 5a28eca
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Continuous Integration

on:
workflow_dispatch:
push:

env:
Expand All @@ -10,10 +11,14 @@ jobs:

test:

name: Rust ${{matrix.rust}}
name: Rust ${{ matrix.rust }}

runs-on: ubuntu-latest

outputs:
passed_rustfmt: ${{ steps.rustfmt.outputs.passed_rustfmt }}
passed_clippy: ${{ steps.clippy.outputs.passed_clippy }}

strategy:
fail-fast: false
matrix:
Expand All @@ -25,12 +30,43 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy

- if: ${{ matrix.rust == 'stable' }}
run: cargo fmt --verbose --all -- --check
- id: rustfmt
name: Rust format
if: ${{ matrix.rust == 'stable' }}
run: |
cargo fmt --verbose --all -- --check
echo "passed_rustfmt=${{ matrix.rust }}" >> "$GITHUB_OUTPUT"
- id: clippy
name: Clippy
if: ${{ matrix.rust == '1.56.1' }}
run: |
cargo clippy --all --all-features --all-targets -- -D warnings
echo "passed_clippy=${{ matrix.rust }}" >> "$GITHUB_OUTPUT"
- id: test
name: Compile and run tests
run: cargo test --verbose

code-checks:

name: Code checks

runs-on: ubuntu-latest

needs: test

steps:

- run: cargo clippy --all --all-features --all-targets -- -D warnings
- name: Rustfmt
run: |
echo "Rustfmt run on ${{ needs.test.outputs.passed_rustfmt }}" >> "$GITHUB_STEP_SUMMARY"
test "${{ needs.test.outputs.passed_rustfmt }}" = "stable"
- run: cargo test --verbose
- name: Clippy
run: |
echo "Clippy run on ${{ needs.test.outputs.passed_clippy }}" >> "$GITHUB_STEP_SUMMARY"
test "${{ needs.test.outputs.passed_clippy }}" = "1.56.1"

0 comments on commit 5a28eca

Please sign in to comment.