| name: Testing | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "5 1 * * *" | |
| jobs: | |
| gofmt: | |
| name: go fmt (Go ${{ matrix.go }}) | |
| runs-on: ubuntu-26.04 | |
| strategy: | |
| matrix: | |
| go: [stable, oldstable] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Run go fmt | |
| if: runner.os != 'Windows' | |
| run: diff -u <(echo -n) <(gofmt -d -s .) | |
| govet: | |
| name: go vet (Go ${{ matrix.go }}) | |
| runs-on: ubuntu-26.04 | |
| strategy: | |
| matrix: | |
| go: [stable, oldstable] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Run go vet | |
| run: make vet | |
| staticcheck: | |
| name: staticcheck (Go ${{ matrix.go }}) | |
| runs-on: ubuntu-26.04 | |
| strategy: | |
| matrix: | |
| go: [stable, oldstable] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Run staticcheck | |
| uses: dominikh/staticcheck-action@9716614d4101e79b4340dd97b10e54d68234e431 # v1.4.1 | |
| with: | |
| # renovate: datasource=github-releases depName=dominikh/go-tools | |
| version: "2026.2.2" | |
| install-go: false | |
| cache-key: ${{ matrix.go }} | |
| golangci-lint: | |
| name: golangci-lint (Go ${{ matrix.go }}) | |
| runs-on: ubuntu-26.04 | |
| strategy: | |
| matrix: | |
| go: [stable, oldstable] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9 | |
| with: | |
| version: v2.14.0 | |
| unittesting: | |
| name: unit testing (Go ${{ matrix.go }}) | |
| runs-on: ubuntu-26.04 | |
| strategy: | |
| matrix: | |
| go: [stable, oldstable] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Run Unit tests. | |
| run: make test |