Bumps [dominikh/staticcheck-action](https://github.com/dominikh/staticcheck-action) from 1.4.0 to 1.4.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dominikh/staticcheck-action/releases">dominikh/staticcheck-action's releases</a>.</em></p> <blockquote> <h2>v1.4.1</h2> <p>Version 1.4.1</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/dominikh/staticcheck-action/blob/master/CHANGES.md">dominikh/staticcheck-action's changelog</a>.</em></p> <blockquote> <h1>1.4.1</h1> <ul> <li>Switch from WillAbides/setup-go-faster to actions/setup-go</li> <li>Pin our dependencies</li> </ul> <h1>1.4.0</h1> <ul> <li>Add <code>use-cache</code> option to disable automatic caching</li> <li>Update README to document all options</li> </ul> <h1>1.3.1</h1> <ul> <li>Update README to be clearer</li> <li>Update README to provide timeless examples</li> <li>Update setup-go-faster dependency from v1.8.0 to v1.14.0</li> <li>Update actions/cache dependency from v3 to v4</li> <li>Update installed Go version from 1.19.x to "stable"</li> </ul> <h1>1.3.0</h1> <ul> <li>Add the output-format option</li> <li>Add the output-file option</li> <li>Add the merge-files option</li> <li>Update action/cache dependency from v2 to v3</li> <li>Update setup-go-faster dependency from v1.7.0 to v1.8.0</li> <li>Update installed Go version from 1.17.x to 1.19.x</li> </ul> <h1>1.2.0</h1> <ul> <li>Add the <code>checks</code> option</li> <li>Add the <code>working-directory</code> option</li> </ul> <h1>1.1.0</h1> <ul> <li>The action will store and restore Go's cache if install-go is set to true.</li> </ul> <h1>1.0.0</h1> <p>Initial release.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="9716614d41"><code>9716614</code></a> Update changelog</li> <li><a href="00d98ae742"><code>00d98ae</code></a> Pin our dependencies</li> <li><a href="203eeae4a9"><code>203eeae</code></a> Switch from WillAbides/setup-go-faster to actions/setup-go</li> <li>See full diff in <a href="024238d289...9716614d41">compare view</a></li> </ul> </details> <br /> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Maciek Kisiel <mkisiel@google.com>
64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
name: Test
|
|
on:
|
|
# Manual trigger
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Set up Go
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: "^1.26"
|
|
- name: Check formatting
|
|
run: |
|
|
unformatted=$(gofmt -l .)
|
|
if [ -n "$unformatted" ]; then
|
|
echo "The following files are not properly formatted:"
|
|
echo "$unformatted"
|
|
exit 1
|
|
fi
|
|
echo "All Go files are properly formatted"
|
|
- name: Run Go vet
|
|
run: go vet ./...
|
|
- name: Run staticcheck
|
|
uses: dominikh/staticcheck-action@9716614d4101e79b4340dd97b10e54d68234e431 # v1.4.1
|
|
with:
|
|
install-go: false
|
|
version: "v0.6.1"
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go: ["1.25", "1.26"]
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Set up Go
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
- name: Test
|
|
run: go test -v ./...
|
|
|
|
race-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Set up Go
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: "1.26"
|
|
- name: Test with -race
|
|
run: go test -v -race ./...
|