Repository navigation
89 lines (71 loc) · 1.86 KB
/
Copy pathgo.yml
File metadata and controls
89 lines (71 loc) · 1.86 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Go
on:
pull_request:
branches: [main]
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "internal/migrate/sql/**"
- "internal/i18n/locales/**"
- "internal/**/templates/**"
- "ftml/**"
- "ftml-capi/**"
- ".github/workflows/go.yml"
permissions:
contents: read
concurrency:
group: go-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: format and vet
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Check formatting
run: |
unformatted=$(gofmt -l cmd internal tools static)
if [ -n "$unformatted" ]; then
echo "These files need gofmt:"
echo "$unformatted"
exit 1
fi
- name: Vet
run: go vet -tags nocgo ./...
migrations:
name: migration declarations
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Every migration declares whether older releases can run on it
run: go test -tags nocgo -run TestEveryMigrationDeclaresCompatibility ./internal/migrate
test:
name: build and test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: ftml-capi
- name: Build the ftml library
working-directory: ftml-capi
run: cargo build --release
- name: Build
run: |
go build ./...
go build -tags nocgo ./...
- name: Vet with cgo
run: go vet ./...
- name: Test
run: go test -p 1 ./...