|
1 | 1 | on: |
2 | 2 | push: |
3 | | - branches: [ main ] |
| 3 | + branches: [main] |
4 | 4 | pull_request: |
5 | 5 | name: Test |
6 | 6 | jobs: |
7 | 7 | test: |
8 | 8 | strategy: |
9 | 9 | matrix: |
10 | | - go-version: [1.20.x,1.21.x] |
| 10 | + go-version: [1.20.x, 1.21.x] |
11 | 11 | platform: [ubuntu-latest, macos-latest, windows-latest] |
12 | 12 | runs-on: ${{ matrix.platform }} |
13 | 13 | steps: |
14 | | - - name: Install Go |
15 | | - uses: actions/setup-go@v4 |
16 | | - with: |
17 | | - go-version: ${{ matrix.go-version }} |
18 | | - - name: Install staticcheck |
19 | | - run: go install honnef.co/go/tools/cmd/staticcheck@latest |
20 | | - shell: bash |
21 | | - - name: Install golint |
22 | | - run: go install golang.org/x/lint/golint@latest |
23 | | - shell: bash |
24 | | - - name: Update PATH |
25 | | - run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH |
26 | | - shell: bash |
27 | | - - name: Checkout code |
28 | | - uses: actions/checkout@v3 |
29 | | - - name: Fmt |
30 | | - if: matrix.platform != 'windows-latest' # :( |
31 | | - run: "diff <(gofmt -d .) <(printf '')" |
32 | | - shell: bash |
33 | | - - name: Vet |
34 | | - run: go vet ./... |
35 | | - - name: Staticcheck |
36 | | - run: staticcheck ./... |
37 | | - - name: Lint |
38 | | - run: golint ./... |
39 | | - - name: Test |
40 | | - run: go test -race ./... -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic |
41 | | - - name: Upload coverage |
42 | | - if: success() && matrix.platform == 'ubuntu-latest' |
43 | | - run: | |
44 | | - curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step |
45 | | - curl -Os https://uploader.codecov.io/latest/linux/codecov |
46 | | - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM |
47 | | - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig |
48 | | - gpgv codecov.SHA256SUM.sig codecov.SHA256SUM |
49 | | - shasum -a 256 -c codecov.SHA256SUM |
50 | | - chmod +x codecov |
51 | | - ./codecov |
| 14 | + - name: Install Go |
| 15 | + uses: actions/setup-go@v4 |
| 16 | + with: |
| 17 | + go-version: ${{ matrix.go-version }} |
| 18 | + - name: Install staticcheck |
| 19 | + run: go install honnef.co/go/tools/cmd/staticcheck@latest |
| 20 | + shell: bash |
| 21 | + - name: Install golint |
| 22 | + run: go install golang.org/x/lint/golint@latest |
| 23 | + shell: bash |
| 24 | + - name: Update PATH |
| 25 | + run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH |
| 26 | + shell: bash |
| 27 | + - name: Checkout code |
| 28 | + uses: actions/checkout@v3 |
| 29 | + - name: Fmt |
| 30 | + if: matrix.platform != 'windows-latest' # :( |
| 31 | + run: "diff <(gofmt -d .) <(printf '')" |
| 32 | + shell: bash |
| 33 | + - name: Vet |
| 34 | + run: go vet ./... |
| 35 | + - name: Staticcheck |
| 36 | + run: staticcheck ./... |
| 37 | + - name: Lint |
| 38 | + run: golint ./... |
| 39 | + - name: Test |
| 40 | + run: go test -race ./... -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic |
| 41 | + - name: Upload coverage |
| 42 | + if: success() && matrix.platform == 'ubuntu-latest' |
| 43 | + run: | |
| 44 | + curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step |
| 45 | + curl -Os https://uploader.codecov.io/latest/linux/codecov |
| 46 | + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM |
| 47 | + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig |
| 48 | + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM |
| 49 | + shasum -a 256 -c codecov.SHA256SUM |
| 50 | + chmod +x codecov |
| 51 | + ./codecov |
0 commit comments