Skip to content

Commit 409bbba

Browse files
committed
ci: cleanup script for testing
1 parent 516dfe2 commit 409bbba

File tree

5 files changed

+96
-114
lines changed

5 files changed

+96
-114
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Run MoonBit Native Release Tests"
2+
description: "Run MoonBit tests with --target native --release"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set ulimit and run moon test (--release + --target native)
7+
if: ${{ runner.os != 'Windows' }}
8+
shell: bash
9+
run: |
10+
ulimit -s 8176
11+
moon test --target native --release
12+
13+
- name: Setup MSVC
14+
if: ${{ runner.os == 'Windows' }}
15+
uses: ilammy/msvc-dev-cmd@v1
16+
17+
- name: Run moon test on Windows (--release + --target native)
18+
if: ${{ runner.os == 'Windows' }}
19+
shell: bash
20+
run: |
21+
moon test --target native --release

.github/actions/test/action.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Run MoonBit Tests"
2+
description: "Run comprehensive MoonBit tests across all targets"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set ulimit and run moon test
7+
if: ${{ runner.os != 'Windows' }}
8+
shell: bash
9+
run: |
10+
ulimit -s 8176
11+
moon test --target all
12+
moon test --release --target js,wasm,wasm-gc # native test in release mode is run in a separate job
13+
14+
- name: Setup MSVC
15+
if: ${{ runner.os == 'Windows' }}
16+
uses: ilammy/msvc-dev-cmd@v1
17+
18+
- name: Run moon test on Windows
19+
if: ${{ runner.os == 'Windows' }}
20+
shell: bash
21+
run: |
22+
moon test --target all
23+
moon test --release --target js,wasm,wasm-gc # native test in release mode is run in a separate job
24+
25+
- name: Run moon test with JS builtin string
26+
if: ${{ runner.os != 'Windows' }}
27+
shell: bash
28+
run: |
29+
ulimit -s 8176
30+
moon test --target wasm-gc
31+
moon test --target wasm-gc --release
32+
env:
33+
MOONC_INTERNAL_PARAMS: use_js_builtin_string = 1 |
34+
35+
- name: Run moon test with JS builtin string
36+
if: ${{ runner.os == 'Windows' }}
37+
shell: bash
38+
run: |
39+
moon test --target wasm-gc
40+
moon test --target wasm-gc --release
41+
env:
42+
MOONC_INTERNAL_PARAMS: use_js_builtin_string = 1 |

.github/workflows/bleeding-check.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,8 @@ jobs:
2222
with:
2323
version: nightly
2424

25-
- name: Set ulimit and run moon test
26-
if: ${{ matrix.os != 'windows-latest' }}
27-
run: |
28-
ulimit -s 8176
29-
moon test --target all
30-
moon test --release --target all
31-
moon test --target native
32-
moon test --release --target native
33-
34-
- name: Setup MSVC
35-
if: ${{ matrix.os == 'windows-latest' }}
36-
uses: ilammy/msvc-dev-cmd@v1
37-
38-
- name: Run moon test on Windows (--target all)
39-
if: ${{ matrix.os == 'windows-latest' }}
40-
run: |
41-
moon test --target all
42-
43-
- name: Run moon test on Windows (--release + --target all)
44-
if: ${{ matrix.os == 'windows-latest' }}
45-
run: |
46-
moon test --release --target all
47-
48-
- name: Run moon test on Windows (--target native)
49-
if: ${{ matrix.os == 'windows-latest' }}
50-
run: |
51-
moon test --target native
25+
- name: run tests
26+
uses: ./.github/actions/test
5227

5328
- name: Test new allocator
5429
run: |
@@ -96,17 +71,5 @@ jobs:
9671
run: |
9772
moon version --all
9873
99-
- name: Set ulimit and run moon test (--release + --target native)
100-
if: ${{ matrix.os != 'windows-latest' }}
101-
run: |
102-
ulimit -s 8176
103-
moon test --target native --release
104-
105-
- name: Setup MSVC
106-
if: ${{ matrix.os == 'windows-latest' }}
107-
uses: ilammy/msvc-dev-cmd@v1
108-
109-
- name: Run moon test on Windows (--release + --target native)
110-
if: ${{ matrix.os == 'windows-latest' }}
111-
run: |
112-
moon test --target native --release
74+
- name: run native release tests
75+
uses: ./.github/actions/test-native-release

.github/workflows/pre-release-check.yml

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -140,38 +140,8 @@ jobs:
140140
- name: check
141141
run: moon check --deny-warn
142142

143-
- name: Set ulimit and run moon test
144-
if: ${{ matrix.os != 'windows-latest' }}
145-
run: |
146-
ulimit -s 8176
147-
moon test --target all
148-
moon test --release --target all
149-
moon test --target native
150-
moon test --target native --release
151-
152-
- name: Setup MSVC
153-
if: ${{ matrix.os == 'windows-latest' }}
154-
uses: ilammy/msvc-dev-cmd@v1
155-
156-
- name: Run moon test on Windows (--target all)
157-
if: ${{ matrix.os == 'windows-latest' }}
158-
run: |
159-
moon test --target all
160-
161-
- name: Run moon test on Windows (--release + --target all)
162-
if: ${{ matrix.os == 'windows-latest' }}
163-
run: |
164-
moon test --release --target all
165-
166-
- name: Run moon test on Windows (--target native)
167-
if: ${{ matrix.os == 'windows-latest' }}
168-
run: |
169-
moon test --target native
170-
171-
- name: Run moon test on Windows (--release + --target native)
172-
if: ${{ matrix.os == 'windows-latest' }}
173-
run: |
174-
moon test --target native --release
143+
- name: run tests
144+
uses: ./.github/actions/test
175145

176146
- name: moon test --doc
177147
run: |
@@ -194,3 +164,26 @@ jobs:
194164
- name: check core size on windows
195165
if: ${{ matrix.os == 'windows-latest' }}
196166
run: Get-ChildItem -Path ".\target" -Recurse -Filter "*.core" | ForEach-Object { "{0} ({1} bytes)" -f $_.FullName, $_.Length }
167+
168+
pre-release-native-opt-test:
169+
needs: version-check
170+
if: ${{ needs.version-check.outputs.should-skip == 'false' }}
171+
continue-on-error: true
172+
strategy:
173+
matrix:
174+
os: [ubuntu-latest, macos-latest, windows-latest]
175+
fail-fast: false
176+
runs-on: ${{ matrix.os }}
177+
steps:
178+
- uses: actions/checkout@v4
179+
180+
- name: install
181+
uses: ./.github/actions/setup
182+
with:
183+
version: pre-release
184+
185+
- name: check
186+
run: moon check --target native --deny-warn
187+
188+
- name: run native release tests
189+
uses: ./.github/actions/test-native-release

.github/workflows/stable-check.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,8 @@ jobs:
3434
moon fmt
3535
git diff --exit-code
3636
37-
- name: Set ulimit and run moon test
38-
if: ${{ matrix.os != 'windows-latest' }}
39-
run: |
40-
ulimit -s 8176
41-
moon test --target all
42-
moon test --release --target all
43-
moon test --target native
44-
moon test --release --target native
45-
46-
- name: Setup MSVC
47-
if: ${{ matrix.os == 'windows-latest' }}
48-
uses: ilammy/msvc-dev-cmd@v1
49-
50-
- name: Run moon test on Windows (--target all)
51-
if: ${{ matrix.os == 'windows-latest' }}
52-
run: |
53-
moon test --target all
54-
55-
- name: Run moon test on Windows (--release + --target all)
56-
if: ${{ matrix.os == 'windows-latest' }}
57-
run: |
58-
moon test --release --target all
59-
60-
- name: Run moon test on Windows (--target native)
61-
if: ${{ matrix.os == 'windows-latest' }}
62-
run: |
63-
moon test --target native
37+
- name: run tests
38+
uses: ./.github/actions/test
6439

6540
- name: moon bundle
6641
run: moon bundle --all
@@ -89,17 +64,5 @@ jobs:
8964
- name: check
9065
run: moon check --target native --deny-warn
9166

92-
- name: Set ulimit and run moon test (--release + --target native)
93-
if: ${{ matrix.os != 'windows-latest' }}
94-
run: |
95-
ulimit -s 8176
96-
moon test --target native --release
97-
98-
- name: Setup MSVC
99-
if: ${{ matrix.os == 'windows-latest' }}
100-
uses: ilammy/msvc-dev-cmd@v1
101-
102-
- name: Run moon test on Windows (--release + --target native)
103-
if: ${{ matrix.os == 'windows-latest' }}
104-
run: |
105-
moon test --target native --release
67+
- name: run native release tests
68+
uses: ./.github/actions/test-native-release

0 commit comments

Comments
 (0)