Skip to content

Commit 08ebfb1

Browse files
committed
Add CI GitHub Actions workflow
1 parent d2ea39a commit 08ebfb1

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,50 @@
1-
name: Deploy WASM
1+
name: CI
22

33
on:
44
push:
55
branches: [main]
6+
pull_request:
7+
branches: [main]
68

79
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- uses: actions/setup-go@v6
17+
with:
18+
go-version-file: go.mod
19+
cache: true
20+
21+
- name: Install system dependencies
22+
run: sudo apt-get install -y libasound2-dev libgl1-mesa-dev libxrandr-dev libxi-dev libxcursor-dev libxinerama-dev libxxf86vm-dev
23+
24+
- name: Lint
25+
run: go tool golangci-lint run
26+
27+
test:
28+
name: Test
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v6
32+
33+
- uses: actions/setup-go@v6
34+
with:
35+
go-version-file: go.mod
36+
cache: true
37+
38+
- name: Install system dependencies
39+
run: sudo apt-get install -y libasound2-dev libgl1-mesa-dev libxrandr-dev libxi-dev libxcursor-dev libxinerama-dev libxxf86vm-dev xvfb
40+
41+
- name: Test
42+
run: xvfb-run go test ./...
43+
844
deploy:
45+
name: Deploy
46+
needs: [lint, test]
47+
if: github.ref == 'refs/heads/main'
948
runs-on: ubuntu-latest
1049
env:
1150
TARGET_DIR: target
@@ -15,6 +54,7 @@ jobs:
1554
- uses: actions/setup-go@v6
1655
with:
1756
go-version-file: go.mod
57+
cache: true
1858

1959
- name: Build WASM
2060
run: GOOS=js GOARCH=wasm go build -o river-raid.wasm .

0 commit comments

Comments
 (0)