-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 2.06 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
62
63
64
name: Workflow for CI
on: [ push, pull_request ]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.21', '1.22', '1.23' ]
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ${{ matrix.go-version }}
- name: Ensure the Go module is nice and tidy
run: |
go mod tidy && git diff --exit-code go.mod go.sum
# We set the shell explicitly, here, and in other golang test actions,
# as by default multi-line shell scripts do not error out on the first
# failed command. Since we want an error reported if any of the lines
# fail, we set the shell explicitly:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions?ref=cloudtechsimplified.com#exit-codes-and-error-action-preference
shell: bash
- name: Install Tools
run: |
pushd "$(mktemp -d)"
go mod init example.com/m # fake module
go install github.com/onsi/ginkgo/v2/[email protected]
go install honnef.co/go/tools/cmd/[email protected]
popd
shell: bash
- name: Verify Go Modules Setup
run: go mod verify
shell: bash
- name: Build
run: go build -v ./...
shell: bash
- name: Sanity Check (staticcheck)
run: staticcheck ./...
shell: bash
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
- name: Test
run: ginkgo -v -race -coverprofile=coverage.out -coverpkg=./... ./...
shell: bash
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: maguro/gslog
flags: smart-tests
verbose: true