From c2c0ce41d829560065c2afae803d51373906eadf Mon Sep 17 00:00:00 2001 From: Cyborg Viktor Date: Tue, 10 Nov 2026 12:01:58 +0000 Subject: [PATCH] Run go vet and the test suite in CI Add a Test workflow that runs go vet and go test -race on every push to master and every pull request, against Go 1.18 (the version go.mod declares) and current stable. Actions are pinned by SHA, and a Dependabot config keeps the pins current. Co-Authored-By: Claude Opus 5.5 Co-authored-by: multica-agent --- .github/dependabot.yml | 10 ++++++++++ .github/workflows/test.yml | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f62a2b0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +--- +# Keeps the pinned action SHAs in .github/workflows current. +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "chore" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cbe8c86 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +--- +# Run the test suite on every push to master and every pull request. +# +# The matrix covers the oldest Go this module declares (go.mod) and the +# current stable release. Consumers such as sbomify/sbom-tools build it with +# whatever their toolchain is, so both ends need to stay green. +name: Test + +on: + push: + branches: [master] + pull_request: + +permissions: + contents: read + +jobs: + test: + name: go ${{ matrix.go }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + go: ["1.18", "stable"] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version: ${{ matrix.go }} + # No go.sum: the module has no dependencies. + cache: false + + - name: go vet + run: go vet ./... + + - name: go test + run: go test -race -count=1 ./...