Skip to content

Commit 60dd018

Browse files
committed
github actions
1 parent 5d142fa commit 60dd018

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: WSNet2 dashboard ci
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- '.github/workflows/wsnet2-dashboard.yml'
8+
- 'wsnet2-dashboard/**'
9+
- 'server/**'
10+
11+
jobs:
12+
gopherjs:
13+
runs-on: "ubuntu-latest"
14+
defaults:
15+
run:
16+
working-directory: wsnet2-dashboard/backend/go-binary
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- uses: actions/setup-go@v3
21+
with:
22+
go-version: '^1.20.0'
23+
cache: true
24+
cache-dependency-path: wsnet2-dashboard/backend/go-binary/go.sum
25+
26+
- uses: arduino/setup-protoc@v1
27+
with:
28+
version: '3.x'
29+
30+
- run: make -C ../../../server generate
31+
32+
- run: go install golang.org/dl/go1.18.5@latest && go1.18.5 download
33+
34+
- run: go1.18.5 test wsnet2/binary
35+
36+
- run: GOARCH=386 go1.18.5 build
37+
38+
- run: go install github.com/gopherjs/[email protected]
39+
40+
- run: GOPHERJS_GOROOT="$(go1.18.5 env GOROOT)" gopherjs build

wsnet2-dashboard/backend/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y wget make && \
99

1010
ENV PATH /root/go/bin:/go/bin:$PATH
1111
RUN cd / && \
12-
wget -O go.tar.gz https://go.dev/dl/go1.18.5.linux-amd64.tar.gz && \
12+
wget -O go.tar.gz https://go.dev/dl/go1.18.5.linux-$([ $(uname -m) = aarch64 ] && echo -n arm64 || echo -n amd64).tar.gz && \
1313
tar xvf go.tar.gz && \
1414
rm go.tar.gz && \
1515
go install github.com/gopherjs/[email protected]

0 commit comments

Comments
 (0)