Skip to content

Commit 43a55dc

Browse files
committed
chore: define GHA setup for tests and linting
Change-Id: I975eb75ae202298f56387a0d4242dda4d84904e2
1 parent 5a478d0 commit 43a55dc

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
lint:
14+
name: "Lint"
15+
strategy:
16+
matrix:
17+
go-version: [ "1.23" ]
18+
os: [ "ubuntu-latest" ]
19+
runs-on: ${{ matrix.os }}
20+
permissions:
21+
pull-requests: read
22+
contents: read
23+
steps:
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version: ${{ matrix.go }}
27+
check-latest: true
28+
- uses: actions/checkout@v4
29+
- name: "Lint"
30+
uses: golangci/golangci-lint-action@v6
31+
with:
32+
only-new-issues: true
33+
args: --timeout 5m --issues-exit-code 0
34+
35+
36+
test:
37+
name: "Test"
38+
strategy:
39+
matrix:
40+
go-version: [ "1.22", "1.23" ]
41+
os: [ "ubuntu-latest", "windows-latest", "macos-latest" ]
42+
runs-on: ${{ matrix.os }}
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-go@v5
46+
with:
47+
go-version: ${{ matrix.go-version }}
48+
check-latest: true
49+
- name: "Run tests"
50+
run: go test -json ./... > test.json
51+
52+
- name: "Annotate tests"
53+
if: always()
54+
uses: guyarb/[email protected]
55+
with:
56+
test-results: test.json

0 commit comments

Comments
 (0)