-
Notifications
You must be signed in to change notification settings - Fork 1.1k
41 lines (35 loc) · 1.08 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
name: Code Check
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
name: Build And Test Go code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# https://stackoverflow.com/questions/76269119/github-actions-go-lambda-project-different-sha256sums
- name: Build
run: go build -v -buildvcs=false ./...
env:
# Make sure to not use dependencies that rely on CGO
CGO_ENABLED: 0
# Make sure to detect eventual race conditions
# (CGO must be enabled to use -race detector)
- name: Test
# -count=2 ensures that test fixtures cleanup after themselves
# because any leftover state will generally cause the second run to fail.
run: go test -race -p 1 -v -shuffle=on -count=2 ./...
- name: Linter
uses: golangci/golangci-lint-action@v6
with:
version: latest
env:
GOFLAGS: "-buildvcs=false"