-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1022 Bytes
/
go-ci.yml
File metadata and controls
48 lines (39 loc) · 1022 Bytes
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
name: Go build ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ci:
runs-on: ubuntu-latest
env:
CGO_ENABLED: 1
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install dependencies
working-directory: ./server
run: go mod download
- name: Run gofmt
working-directory: ./server
run: |
fmt_output=$(gofmt -l .)
if [ -n "$fmt_output" ]; then
echo " Files not properly formatted:"
echo "$fmt_output"
exit 1
fi
- name: Run go vet
working-directory: ./server
run: go vet ./...
- name: Build API
working-directory: ./server
run: go build -tags sqlite ./cmd/api
- name: Build Migrations
working-directory: ./server
run: go build -tags sqlite ./cmd/migrate/migrations