forked from gopherjs/gopherjs
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (166 loc) · 5.36 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
name: CI
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
permissions:
contents: read
env:
GO_VERSION: 1.19.13
NODE_VERSION: 20
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
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
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/
- 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 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: Get TodoMVC repo
working-directory: ${{ env.GOPHERJS_PATH }}
run: go get -v github.com/gopherjs/todomvc
- name: Run TodoMVC tests
working-directory: ${{ env.GOPHERJS_PATH }}
run: gopherjs test -v github.com/gopherjs/todomvc/...
gopherjs_tests:
name: GopherJS 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: |
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 \
)
gopherjs test -p 2 --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