Skip to content

Commit 08009ff

Browse files
author
aereal
authored
Merge pull request #24 from aereal/update-actions
ci: update actions
2 parents 571666d + 386ca2e commit 08009ff

File tree

2 files changed

+49
-16
lines changed

2 files changed

+49
-16
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,43 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: lint
1515
uses: reviewdog/action-golangci-lint@v2
1616
test:
1717
strategy:
1818
matrix:
1919
go_version:
20-
- 1.14.x
21-
- 1.15.x
22-
- 1.16.x
23-
- 1.17.x
20+
- 1.21.x
21+
- 1.20.x
22+
- 1.19.x
2423
os:
2524
- ubuntu-latest
2625
runs-on: ${{ matrix.os }}
2726
steps:
28-
- uses: actions/checkout@v3
29-
- uses: actions/setup-go@v3
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-go@v5
3029
with:
3130
go-version: ${{ matrix.go_version }}
32-
- uses: actions/cache@v3
33-
with:
34-
path: ~/go/pkg/mod
35-
key: ${{ runner.os }}-go-${{ matrix.go_version }}-${{ hashFiles('**/go.sum') }}
36-
restore-keys: |
37-
${{ runner.os }}-go-${{ matrix.go_version }}
3831
- name: test
39-
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
40-
- uses: codecov/codecov-action@v3
41-
if: matrix.os == 'ubuntu-latest' && matrix.go_version == '1.17.x'
32+
run: go test -race -coverprofile=cover.out -covermode=atomic ./...
33+
- uses: actions/upload-artifact@v3
34+
if: strategy.job-index == 0
35+
with:
36+
name: coverage
37+
path: ./cover.out
38+
if-no-files-found: error
39+
report-coverage:
40+
runs-on: ubuntu-latest
41+
permissions:
42+
actions: read
43+
contents: read
44+
pull-requests: write
45+
needs:
46+
- test
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/download-artifact@v3
50+
with:
51+
name: coverage
52+
- uses: k1LoW/octocov-action@v0

.octocov.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
3+
coverage:
4+
if: true
5+
codeToTestRatio:
6+
code:
7+
- '**/*.go'
8+
- '!**/*_test.go'
9+
test:
10+
- '**/*_test.go'
11+
testExecutionTime:
12+
if: true
13+
diff:
14+
datastores:
15+
- artifact://${GITHUB_REPOSITORY}
16+
report:
17+
datastores:
18+
- artifact://${GITHUB_REPOSITORY}
19+
comment:
20+
if: is_pull_request
21+
summary:
22+
if: is_pull_request

0 commit comments

Comments
 (0)