From 4c0cb4fe05cb0b881c1fbe0d16320fb9ee1221ff Mon Sep 17 00:00:00 2001 From: C Date: Fri, 21 Aug 2026 06:12:17 +0000 Subject: [PATCH] ci: run the test suite on pull requests --- .github/workflows/tests.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..16c97b8 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,34 @@ +name: tests + +# Runs on pull requests as well as main. go-packages.yml also runs the suite, +# but only after a merge, so a failing test could not be caught before landing. +on: + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + persist-credentials: false + - uses: actions/setup-go@7b8cf10d4e4a01d4992d18a89f4d7dc5a3e6d6f4 # v4 + with: + go-version: '1.22' + cache: true + - name: Vet + run: go vet ./... + # -race is the point: the suite spins up httptest servers whose handlers + # touch state the assertions read. No API key is set, so anything needing + # live credentials skips. + - name: Test + run: go test -race ./...