forked from sirgwain/craig-stars
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.18 KB
/
build.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
# workflow to build & test on each commit to develop or PR to develop
name: Build
on:
pull_request:
branches:
- 'develop'
push:
branches:
- 'develop'
jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
node-version: [18]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# build the binary (fast)
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache: true
- run: go test ./...
- run: mkdir -p dist/
- run: go mod tidy && CGO_ENABLED=1 GOARCH=amd64 GOOS=linux go build -ldflags='-s -w -extldflags "-static"' -o dist/craig-stars main.go
- run: make build_wasm
# build the frontend (slow)
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- run: npm install
working-directory: ./frontend
- run: npm run test
working-directory: ./frontend
- run: npm run build
working-directory: ./frontend