|
@@ -1,37 +1,44 @@
|
|
|
-name: Go
|
|
|
+# Maintained in https://github.com/coreos/repo-templates
|
|
|
+# Do not edit downstream.
|
|
|
|
|
|
+name: Go
|
|
|
on:
|
|
|
push:
|
|
|
branches: [main]
|
|
|
pull_request:
|
|
|
branches: [main]
|
|
|
-
|
|
|
permissions:
|
|
|
contents: read
|
|
|
|
|
|
-env:
|
|
|
- SUDO_PERMITTED: 1
|
|
|
+# don't waste job slots on superseded code
|
|
|
+concurrency:
|
|
|
+ group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
+ cancel-in-progress: true
|
|
|
|
|
|
jobs:
|
|
|
test:
|
|
|
name: Test
|
|
|
strategy:
|
|
|
matrix:
|
|
|
- go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
|
|
|
+ go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x]
|
|
|
runs-on: ubuntu-latest
|
|
|
steps:
|
|
|
- name: Set up Go 1.x
|
|
|
- uses: actions/setup-go@v3
|
|
|
+ uses: actions/setup-go@v4
|
|
|
with:
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
- name: Check out repository
|
|
|
uses: actions/checkout@v3
|
|
|
- - name: Install dependencies
|
|
|
+ - name: Install Go dependencies
|
|
|
run: go get golang.org/x/tools/cmd/cover
|
|
|
- - name: Run tests
|
|
|
- run: ./test
|
|
|
+ - name: Check modules
|
|
|
+ run: go mod verify
|
|
|
+ - name: Build
|
|
|
+ run: ./build
|
|
|
+ - name: Test
|
|
|
+ run: SUDO_PERMITTED=1 ./test
|
|
|
- name: Run linter
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
with:
|
|
|
- version: v1.48.0
|
|
|
+ version: v1.52.2
|
|
|
args: -E=gofmt --timeout=30m0s
|