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