-
Notifications
You must be signed in to change notification settings - Fork 90
270 lines (222 loc) · 7.42 KB
/
check.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
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
name: check
on:
push:
branches:
- main
pull_request:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
continue-on-error: false
steps:
- uses: actions/checkout@v4
- name: install
if: ${{ matrix.os != 'windows-latest' }}
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: install on windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser; irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
"C:\Users\runneradmin\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: moon version
run: |
moon version --all
moonrun --version
- name: moon check
run: moon check --deny-warn
- name: moon info
run: |
moon info
git diff --exit-code
- name: Set ulimit and run moon test
if: ${{ matrix.os != 'windows-latest' }}
run: |
ulimit -s 8176
moon test --target all
moon test --release --target all
moon test --target native
moon test --target native --release
- name: Setup MSVC
if: ${{ matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Run moon test on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
moon test --target all
moon test --release --target all
moon test --target native
- name: moon test --doc
run: |
moon test --doc
- name: moon bundle
run: moon bundle --all
- name: check core size
if: ${{ matrix.os != 'windows-latest' }}
run: find ./target -name '*.core' | xargs ls -lh
- name: check core size on windows
if: ${{ matrix.os == 'windows-latest' }}
run: Get-ChildItem -Path ".\target" -Recurse -Filter "*.core" | ForEach-Object { "{0} ({1} bytes)" -f $_.FullName, $_.Length }
- name: format diff
run: |
moon fmt --block-style
git diff --exit-code
coverage-check:
runs-on: macos-14
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: install
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: moon test
run: moon test --enable-coverage
- name: coverage report
run: |
moon coverage report -f summary > coverage_summary.txt
# Put the coverage report in the pipline output
cat coverage_summary.txt >> "$GITHUB_STEP_SUMMARY"
# We don't use the official coveralls upload tool because it takes >1min to build itself
moon coverage report \
-f coveralls \
-o codecov_report.json \
--service-name github \
--service-job-id "$GITHUB_RUN_NUMBER" \
--service-pull-request "${{ github.event.number }}" \
--send-to coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
typo-check:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
FORCE_COLOR: 1
TYPOS_VERSION: v1.19.0
steps:
- name: download typos
run: curl -LsSf https://github.com/crate-ci/typos/releases/download/$TYPOS_VERSION/typos-$TYPOS_VERSION-x86_64-unknown-linux-musl.tar.gz | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: check typos
run: typos
license-header-check:
runs-on: ubuntu-latest
env:
HAWKEYE_VERSION: v5.5.1
steps:
- uses: actions/checkout@v4
- name: Download HawkEye
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/korandoru/hawkeye/releases/download/$HAWKEYE_VERSION/hawkeye-installer.sh | sh
- name: Check License Header
run: hawkeye check
nightly-check:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
fail-fast: false
continue-on-error: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: install
if: ${{ matrix.os != 'windows-latest' }}
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s 'nightly'
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: install on windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
"C:\Users\runneradmin\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
env:
MOONBIT_INSTALL_VERSION: nightly
- name: moon version
run: |
moon version --all
moonrun --version
- name: moon check
run: moon check --deny-warn
- name: Set ulimit and run moon test
if: ${{ matrix.os != 'windows-latest' }}
run: |
ulimit -s 8176
moon test --target all
moon test --release --target all
moon test --target native
moon test --target native --release
- name: Setup MSVC
if: ${{ matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Run moon test on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
moon test --target all
moon test --release --target all
moon test --target native
- name: moon test --doc
run: |
moon test --doc
- name: moon bundle
run: moon bundle --all
- name: moon info
run: |
moon info
git diff
- name: check core size
if: ${{ matrix.os != 'windows-latest' }}
run: find ./target -name '*.core' | xargs ls -lh
- name: check core size on windows
if: ${{ matrix.os == 'windows-latest' }}
run: Get-ChildItem -Path ".\target" -Recurse -Filter "*.core" | ForEach-Object { "{0} ({1} bytes)" -f $_.FullName, $_.Length }
- name: format diff
run: |
moon fmt
git diff
bleeding-check:
continue-on-error: true
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: install
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s 'bleeding'
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: moon version
run: |
moon version --all
moonrun --version
- name: moon check
run: moon check --deny-warn
- name: Set ulimit and run moon test
run: |
ulimit -s 8176
moon test --target all
moon test --release --target all
moon test --target native
moon test --target native --release
- name: moon test --doc
run: |
moon test --doc
- name: moon bundle
run: moon bundle --all
- name: moon info
run: |
moon info
git diff
- name: check core size
run: find ./target -name '*.core' | xargs ls -lh
- name: format diff
run: |
moon fmt
git diff