Skip to content

Commit 7dcacce

Browse files
committed
👷 Modernize the CI
1 parent d7c634e commit 7dcacce

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

.github/workflows/go.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
name: Go
2-
on: [push]
3-
jobs:
42

3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
510
build:
6-
name: Build
11+
name: Build and Test
712
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
816
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.23'
24+
cache: true
25+
26+
- name: Download dependencies
27+
run: go mod download
28+
29+
- name: Verify dependencies
30+
run: go mod verify
31+
32+
- name: Run tests
33+
run: go test -v -race -coverprofile=coverage.out ./...
934

10-
- name: Set up Go 1.14
11-
uses: actions/setup-go@v1
35+
- name: Upload coverage to Codecov
36+
uses: codecov/codecov-action@v4
1237
with:
13-
go-version: 1.14
14-
id: go
15-
16-
- name: Check out code into the Go module directory
17-
uses: actions/checkout@v1
18-
19-
- name: Get dependencies
20-
run: |
21-
go get -v -t -d ./...
22-
if [ -f Gopkg.toml ]; then
23-
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
24-
dep ensure
25-
fi
26-
27-
- name: Build
28-
run: go build -v .
38+
file: ./coverage.out
39+
flags: unittests
40+
name: codecov-umbrella
41+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)