-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (68 loc) · 1.81 KB
/
run-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
62
63
64
65
66
67
68
69
70
71
72
73
name: "CI"
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "*"
pull_request:
permissions:
contents: read
pull-requests: read
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
ci:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
go: ["1.21.x", "1.22.x"]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Go
uses: WillAbides/[email protected]
with:
go-version: ${{ matrix.go }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Static code analysis
uses: dominikh/staticcheck-action@v1
with:
version: "latest"
install-go: false
cache-key: ${{ matrix.go }}
- name: Run Go vet
run: "go vet ./..."
- name: Make all
run: "make all"
- name: Unit tests
run: "go test ./..."
coverage:
runs-on: "ubuntu-latest"
steps:
- name: Setup Go
uses: WillAbides/[email protected]
with:
go-version: "1.22.x"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install dependencies
run: |
go mod download
- name: Run Unit tests
run: |
go test -race -covermode atomic -coverprofile=covprofile ./...
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=covprofile -service=github