|
@@ -0,0 +1,37 @@
|
|
|
+name: Go
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ branches: [main]
|
|
|
+ pull_request:
|
|
|
+ branches: [main]
|
|
|
+
|
|
|
+permissions:
|
|
|
+ contents: read
|
|
|
+
|
|
|
+env:
|
|
|
+ SUDO_PERMITTED: 1
|
|
|
+
|
|
|
+jobs:
|
|
|
+ test:
|
|
|
+ name: Test
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ go-version: [1.16.x, 1.17.x, 1.18.x]
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - name: Set up Go 1.x
|
|
|
+ uses: actions/setup-go@v2
|
|
|
+ with:
|
|
|
+ go-version: ${{ matrix.go-version }}
|
|
|
+ - name: Check out repository
|
|
|
+ uses: actions/checkout@v2
|
|
|
+ - name: Install dependencies
|
|
|
+ run: go get golang.org/x/tools/cmd/cover
|
|
|
+ - name: Run tests
|
|
|
+ run: ./test
|
|
|
+ - name: Run linter
|
|
|
+ uses: golangci/golangci-lint-action@v2
|
|
|
+ with:
|
|
|
+ version: v1.46.2
|
|
|
+ args: -E=gofmt --timeout=30m0s
|