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 ./...