-
Notifications
You must be signed in to change notification settings - Fork 19
66 lines (55 loc) · 1.87 KB
/
go.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
name: Go
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.21.0"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.7.0
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.54.2
args: --timeout 3m0s --verbose --modules-download-mode readonly
- name: Run staticcheck # see: staticcheck.io
uses: dominikh/staticcheck-action@v1.3.0
with:
version: "2023.1.2"
install-go: false
min-go-version: 1.21
- uses: ./.github/actions/mkcert
- name: Build
run: go build -v ./...
- name: Test
run: go test ./... -count=2 -shuffle=on -timeout 1m -v -failfast
- name: Check for race conditions
# Only executes when triggered by a push to the main branch
if: ${{ github.ref_name == 'main' }}
run: go test ./... -timeout 4m -v -failfast -race
- name: Archive logs
if: always()
uses: actions/upload-artifact@v2
with:
name: integration-test-logs
path: ./**/*.log
- name: Tidy
run: go mod tidy
- name: check git tree is clean
# This will fail the job if any previous step (re)generated a file
# that doesn't match what you checked in (or forgot to check in)
run: git diff --exit-code
- name: Notify slack fail
if: ${{ failure() && github.ref == 'refs/heads/main'}}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: C03G4AUGA7M
status: FAILED
color: danger