-
Notifications
You must be signed in to change notification settings - Fork 12
50 lines (41 loc) · 1.17 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
name: Go
on:
push:
branches: ['main', '*.*-dev', '*.*.*-dev']
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.23.1"
- name: Build
run: |
cd yb-voyager
go build -v ./...
- name: Verify Build Tags in Test Files
run: |
MISSING_TAGS=$(grep -L '//go:build' $(find . -type f -name '*_test.go' | grep -v vendor) || true)
if [[ -n "$MISSING_TAGS" ]]; then
echo "The following test files are missing a build tag: "
echo "$MISSING_TAGS"
echo "Ensure all test files have a build tag. If a new build tag is introduced, make sure to update the workflow to trigger the tests for that build tag."
exit 1
fi
- name: Test
run: |
cd yb-voyager
go test -v ./... -tags 'unit'
- name: Vet
run: |
cd yb-voyager
go vet ./...
- name: Run staticcheck
run: |
cd yb-voyager
go install honnef.co/go/tools/cmd/staticcheck@2024.1.1
staticcheck ./...