diff --git a/.github/workspaces/ci.yaml b/.github/workspaces/ci.yaml new file mode 100644 index 0000000..a321446 --- /dev/null +++ b/.github/workspaces/ci.yaml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + name: rustfmt + runs-on: [windows-latest, macos-latest, ubuntu-latest] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@1.72.0 + with: + components: rustfmt + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Run cargo fmt + run: cargo fmt --all -- --check + + test: + name: cargo test + runs-on: [windows-latest, macos-latest, ubuntu-latest] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Install cargo-nextest + uses: baptiste0928/cargo-install@v2 + with: + crate: cargo-nextest + locked: true + cache-key: ${{ runner.arch }}_${{ runner.os }} + + - name: Run tests + run: cargo nextest run --all-targets --all-features