diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4ee28a1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,75 @@ +name: test + +on: + push: + branches: + - main + - master + - "claude/**" + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + +jobs: + rust-test: + name: cargo test (workspace) + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: workspace + - run: cargo test --workspace --all-features --no-fail-fast + + rust-fmt: + name: cargo fmt --check + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - run: cargo fmt --all -- --check + + rust-clippy: + name: cargo clippy + runs-on: ubuntu-latest + timeout-minutes: 30 + # Clippy has never been enforced on this repo; surface findings without + # blocking other jobs until the codebase is brought into compliance. + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + with: + shared-key: workspace + - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + + go-test: + name: go test (poly-verified-go) + runs-on: ubuntu-latest + timeout-minutes: 15 + defaults: + run: + working-directory: poly-verified-go + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: poly-verified-go/go.mod + cache: false + - run: go vet ./... + - run: go test ./... -race -count=1