-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (53 loc) · 1.35 KB
/
ci.yaml
File metadata and controls
56 lines (53 loc) · 1.35 KB
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
---
name: ci
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
# Publish `main` as Docker `latest` image.
branches:
- main
# Run tests for PRs
pull_request:
env:
GO_LANGCI_LINT_VERSION: 2.11.4
GO_TESTSUM_VERSION: 1.13.0
jobs:
test:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v6
-
name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
-
name: Lint
uses: golangci/golangci-lint-action@v9
with:
version: "v${{ env.GO_LANGCI_LINT_VERSION }}"
args: --timeout=10m
-
name: Lint example
uses: golangci/golangci-lint-action@v9
with:
version: "v${{ env.GO_LANGCI_LINT_VERSION }}"
args: --timeout=10m
working-directory: example
-
name: Test Setup
uses: gertd/action-gotestsum@v3.0.0
with:
gotestsum_version: ${{ env.GO_TESTSUM_VERSION }}
-
name: Test
run: |
gotestsum --format short-verbose -- -count=1 -v -timeout=120s -coverprofile=cover.out -coverpkg=./... ./...
-
name: Upload code coverage
uses: shogo82148/actions-goveralls@v1
continue-on-error: true
with:
path-to-profile: cover.out