Skip to content

Commit 636a33d

Browse files
committed
[actions] refresh lint and test action
1 parent b886db3 commit 636a33d

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed
Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
1-
name: Lint and Test
1+
name: Go
2+
23
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [master]
7+
paths:
8+
- "**.go"
9+
- "go.mod"
10+
- "go.sum"
311
pull_request:
4-
5-
permissions:
6-
contents: read
12+
branches: [master]
13+
paths:
14+
- "**.go"
15+
- "go.mod"
16+
- "go.sum"
717

818
jobs:
919
golangci:
1020
name: Lint
1121
runs-on: ubuntu-latest
1222
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-go@v5
23+
# step 1: checkout repository code
24+
- name: Checkout code into workspace directory
25+
uses: actions/checkout@v4
26+
27+
# step 2: set up go
28+
- name: Set up Go
29+
uses: actions/setup-go@v5
1530
with:
1631
go-version: stable
17-
- name: golangci-lint
32+
33+
# step 3: run golangci-lint
34+
- name: Run golangci-lint
1835
uses: golangci/golangci-lint-action@v6
1936
with:
2037
version: latest
@@ -41,3 +58,9 @@ jobs:
4158
# step 4: run test
4259
- name: Run coverage
4360
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
61+
62+
# step 5: upload coverage
63+
# - name: Upload coverage to Codecov
64+
# uses: codecov/codecov-action@v4
65+
# with:
66+
# token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)