forked from gopherjs/gopherjs
-
Notifications
You must be signed in to change notification settings - Fork 0
223 lines (211 loc) · 6.94 KB
/
ci.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: CI
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
GO_VERSION: 1.19.13
NODE_VERSION: 18
GOLANGCI_VERSION: v1.53.3
GOPHERJS_EXPERIMENT: generics
SOURCE_MAP_SUPPORT: true
GOPATH: ${{ github.workspace }}/go
GOPHERJS_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
jobs:
ubuntu_smoke:
name: Ubuntu Smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- name: Copy Actions
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
with:
includeSyscall: 'true'
- name: Test GopherJS
working-directory: ${{ env.GOPHERJS_PATH }}
run: go test -v -short ./...
- name: Run Tests
working-directory: ${{ env.GOPHERJS_PATH }}
run: |
gopherjs build -v net/http
gopherjs test -v --short fmt log ./tests
windows_smoke:
name: Window Smoke
runs-on: windows-latest
env:
# Windows does not support source maps.
SOURCE_MAP_SUPPORT: false
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- name: Copy Actions
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
with:
fixTemps: 'true'
- name: Test GopherJS
working-directory: ${{ env.GOPHERJS_PATH }}
run: go test -v -short ./...
- name: Run Tests
working-directory: ${{ env.GOPHERJS_PATH }}
run: |
gopherjs build -v net/http
gopherjs test -v --short fmt sort ./tests
darwin_smoke:
name: Darwin Smoke
runs-on: macos-latest
env:
# Node version '12' is not found for darwin.
NODE_VERSION: 20
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- name: Copy Actions
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: Test GopherJS
working-directory: ${{ env.GOPHERJS_PATH }}
run: go test -v -short ./...
- name: Run Tests
working-directory: ${{ env.GOPHERJS_PATH }}
run: |
gopherjs build -v net/http
gopherjs test -v --short fmt log os ./tests
lint:
name: Lint Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v3
with:
working-directory: ${{ env.GOPHERJS_PATH }}
version: ${{ env.GOLANGCI_VERSION }}
only-new-issues: true
- name: Check go.mod
working-directory: ${{ env.GOPHERJS_PATH }}
run: go mod tidy && git diff --exit-code
- name: Check natives build tags
working-directory: ${{ env.GOPHERJS_PATH }}
# All those packages should have // +build js.
run: diff -u <(echo -n) <(go list ./compiler/natives/src/...)
go_tests:
name: Go Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- name: Copy Actions
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
with:
includeSyscall: 'true'
- name: Run Tests
working-directory: ${{ env.GOPHERJS_PATH }}
# Run all tests except gorepo tests.
run: go test -v -race $(go list ./... | grep -v github.com/gopherjs/gopherjs/tests/gorepo)
todomvc_check:
name: TodoMVC GO111MODULE Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- name: Copy Actions
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: TodoMVC in GOPATH mode
working-directory: ${{ env.GOPHERJS_PATH }}
env:
GO111MODULE: off
GOPATH: /tmp/gopath
run: |
mkdir -p $GOPATH/src/github.com/gopherjs/gopherjs
cp -r -p ${{ env.GOPHERJS_PATH }}/. $GOPATH/src/github.com/gopherjs/gopherjs/
go get -v github.com/gopherjs/todomvc
gopherjs build -v -o /tmp/todomvc_gopath.js github.com/gopherjs/todomvc
gopherjs test -v github.com/gopherjs/todomvc/...
find $GOPATH
- name: TodoMVC in Go Modules mode
env:
GO111MODULE: on
GOPATH: /tmp/gmod
run: |
mkdir -p $GOPATH/src
cd /tmp
git clone --depth=1 https://github.com/gopherjs/todomvc.git
cd /tmp/todomvc
gopherjs build -v -o /tmp/todomvc_gomod.js github.com/gopherjs/todomvc
gopherjs test -v github.com/gopherjs/todomvc/...
find $GOPATH
- name: Compare GOPATH and Go Modules output
run: |
diff -u \
<(sed 's/todomvc_gomod.js.map/todomvc_ignored.js.map/' /tmp/todomvc_gomod.js) \
<(sed 's/todomvc_gopath.js.map/todomvc_ignored.js.map/' /tmp/todomvc_gopath.js)
gopherjs_tests:
name: GopherJS Tests (${{ matrix.filter.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
filter:
- name: non-crypto
pattern: '-Pve "^crypto"'
- name: cypto
pattern: '-Pe "^crypto"'
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- name: Copy Actions
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: Run GopherJS tests
working-directory: ${{ env.GOPHERJS_PATH }}
run: |
PACKAGE_NAMES=$( \
GOOS=js GOARCH=wasm go list std github.com/gopherjs/gopherjs/js/... github.com/gopherjs/gopherjs/tests/... \
| grep -v -x -f .std_test_pkg_exclusions \
| grep ${{ matrix.filter.pattern }} \
)
echo "Running tests for packages:"
echo "$PACKAGE_NAMES"
gopherjs test -p 4 --minify -v --short $PACKAGE_NAMES
gorepo_tests:
name: Gorepo Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.GOPHERJS_PATH }}
- name: Copy Actions
run: cp -r ${{ env.GOPHERJS_PATH }}/.github .
- name: Setup GopherJS
uses: ./.github/actions/setup-gopherjs/
- name: Run GopherJS tests
working-directory: ${{ env.GOPHERJS_PATH }}
run: go test -v github.com/gopherjs/gopherjs/tests/gorepo