diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32aa5e1..525ca9a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,41 +1,33 @@ name: ci -on: [ push ] +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + env: CARGO_TERM_COLOR: always jobs: ci: runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - beta - - nightly steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 + - name: Checkout + uses: actions/checkout@v4 + - name: Install toolchain + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - components: rustfmt, clippy - - - uses: actions-rs/cargo@v1 - with: - command: build - - - uses: actions-rs/cargo@v1 - with: - command: test - - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - - uses: actions-rs/cargo@v1 + components: clippy, rustfmt + - name: Cache + uses: Swatinem/rust-cache@v2 + - name: Build test + run: cargo build --release --verbose + - name: Run tests + run: cargo test --verbose + - uses: giraffate/clippy-action@v1 with: - command: clippy + reporter: 'github-pr-review' + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Check formatting + run: cargo fmt --all --check