Skip to content

Commit c0751f7

Browse files
committed
ci: Move checkout to the top
1 parent 9ee156c commit c0751f7

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

.github/workflows/test.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
on:
22
push:
3-
branches: [ main ]
3+
branches: [main]
44
pull_request:
55
name: Test
66
jobs:
77
test:
88
strategy:
99
matrix:
1010
go-version: [1.22.x, 1.23.x]
11-
platform: [ macos-latest, ubuntu-latest, windows-latest]
11+
platform: [macos-latest, ubuntu-latest, windows-latest]
1212
runs-on: ${{ matrix.platform }}
1313
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:
3017
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

Comments
 (0)