diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5cd2599..cbf2929 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,29 +1,43 @@ name: CI - on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - name: Build + run: cargo build --all-features --verbose + check: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt, clippy + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 - name: Check code format run: cargo fmt -- --check - name: Check clippy - run: cargo clippy -- --deny warnings - - name: Build - run: cargo build --verbose - - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo clippy --all-features -- --deny warnings + + test: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + include: + - os: macos-latest + - os: ubuntu-latest + - os: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - name: Run tests + run: cargo test --all-features env: CARGO_INCREMENTAL: '0' RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort' @@ -34,7 +48,13 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ${{ steps.coverage.outputs.report }} - - name: Run benchmarks - run: cargo bench --verbose + if: github.event_name == 'pull_request' + + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 - name: Build docs run: cargo doc --verbose