-
Notifications
You must be signed in to change notification settings - Fork 16
61 lines (49 loc) · 1.28 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# GitHub Actions - CI for Go to build & test.
# Based on copy of https://github.com/fxamacker/cbor/workflows/ci.yml
name: ci
# Remove default permissions at top level and grant in jobs.
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
- 'feature/**'
- 'v**'
pull_request:
branches:
- main
- 'feature/**'
- 'v**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
# Test on various OS with default Go version.
tests:
name: Test on ${{matrix.os}}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest]
go-version: ['1.22', '1.23']
steps:
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build project
run: go build ./...
- name: Run tests
run: |
go version
go test -timeout 180m -race -v ./...