-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (41 loc) · 1023 Bytes
/
ci.yml
File metadata and controls
49 lines (41 loc) · 1023 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
49
name: CI
on:
pull_request:
push:
branches:
- main
env:
GO_VERSION: '1.24.1'
jobs:
test:
name: Test and Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Sync Go workspace
run: go work sync
- name: Check code formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not formatted:"
echo "$unformatted"
exit 1
fi
- name: Run tests
run: |
(cd backend && go test -p=1 ./...)
(cd frontend/cli && go test -p=1 ./...)
(cd shared && go test ./...)
(cd api/go && go test ./...)
env:
CGO_ENABLED: 0
- name: Build CLI
run: go build -o construct ./frontend/cli
env:
CGO_ENABLED: 0