Skip to content

Commit 2dde1cd

Browse files
authored
Merge pull request #18 from openconfig/ci/add-go-test-workflow
ci: add GitHub Actions workflow to run go test
2 parents d41fb27 + a695c62 commit 2dde1cd

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/go-test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Go CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Run go test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: 1.24.4
22+
23+
- name: Cache Go modules
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.cache/go-build
28+
${{ env.GOMODCACHE }}
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
33+
- name: Verify modules
34+
run: go mod verify
35+
36+
- name: Run tests
37+
run: go test ./... -v

0 commit comments

Comments
 (0)