-
Notifications
You must be signed in to change notification settings - Fork 9
189 lines (185 loc) · 6.13 KB
/
Copy pathci.yaml
File metadata and controls
189 lines (185 loc) · 6.13 KB
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
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
ci:
name: CI
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm, windows-11-arm]
version: [11, 17, 21, 25]
exclude:
- os: windows-11-arm
version: 11
- os: windows-11-arm
version: 17
- os: windows-11-arm
version: 25
# Flaky, re-enable when the bug on the JVM is fixed
- os: windows-latest
version: 17
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Checkout testsuite
uses: actions/checkout@v6
with:
repository: WebAssembly/testsuite
path: testsuite
# The ref needs to stay in sync with the default value in test-gen-plugin
ref: 88e97b0f742f4c3ee01fea683da130f344dd7b02
- name: Checkout wasi-testsuite
uses: actions/checkout@v6
with:
repository: WebAssembly/wasi-testsuite
path: wasi-testsuite
ref: prod/testsuite-base
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '${{ matrix.version }}'
cache: maven
- name: Test Java
run: mvn -B clean install
env:
MAVEN_OPTS: "-ea"
docs-ci:
runs-on: ubuntu-latest
name: CI - Docs
steps:
- name: checkout
uses: actions/checkout@v6
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
cache: maven
- name: set up Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Build Endive
run: ./mvnw -B -Dquickly
- name: Test Docs
working-directory: docs
run: |
npm ci
npm run build
npm run test
test-results:
name: Test Results
permissions:
contents: write
checks: write
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
folder: [runtime-tests, compiler-tests, wasi-tests]
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Checkout testsuite
uses: actions/checkout@v6
with:
repository: WebAssembly/testsuite
path: testsuite
# The ref needs to stay in sync with the default value in test-gen-plugin
ref: 88e97b0f742f4c3ee01fea683da130f344dd7b02
- name: Checkout wasi-testsuite
uses: actions/checkout@v6
with:
repository: WebAssembly/wasi-testsuite
path: wasi-testsuite
ref: prod/testsuite-base
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
cache: maven
- name: Test Java
run: ./mvnw -B clean install
- name: Name
id: name
run: |
case ${{ matrix.folder }} in
runtime-tests)
echo "NAME=Interpreter" >> $GITHUB_ENV
echo "BADGE_NAME=interpreter" >> $GITHUB_ENV
;;
compiler-tests)
echo "NAME=Compiler" >> $GITHUB_ENV
echo "BADGE_NAME=compiler" >> $GITHUB_ENV
;;
wasi-tests)
echo "NAME=WASI" >> $GITHUB_ENV
echo "BADGE_NAME=wasi" >> $GITHUB_ENV
;;
esac
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040
id: test-results
with:
check_name: ${{ env.NAME }} Tests Results
comment_mode: off
compare_to_earlier_commit: false
files: './${{ matrix.folder }}/**/surefire-reports/*.xml'
- name: Publish badge conditional
id: publish
if: |
(github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' ||
github.event_name != 'workflow_run' && github.ref == 'refs/heads/main')
run: echo "badge=true" >> $GITHUB_OUTPUT
- name: Set badge color
shell: bash
if: steps.publish.outputs.badge
run: |
case ${{ fromJSON( steps.test-results.outputs.json ).conclusion }} in
success)
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV
;;
failure)
echo "BADGE_COLOR=800000" >> $GITHUB_ENV
;;
neutral)
echo "BADGE_COLOR=696969" >> $GITHUB_ENV
;;
esac
- name: Create badge
uses: emibcn/badge-action@f9150fde070fcca0c4e832437611b44838fcd325
if: steps.publish.outputs.badge
with:
label: 'Tests ${{ env.NAME }}'
status: '${{ fromJSON( steps.test-results.outputs.json ).stats.tests_succ }} success, ${{ fromJSON( steps.test-results.outputs.json ).stats.tests_skip }} skip, ${{ fromJSON( steps.test-results.outputs.json ).stats.tests_fail }} failures, ${{ fromJSON( steps.test-results.outputs.json ).stats.tests_error }} errors, ${{ fromJSON( steps.test-results.outputs.json ).stats.tests }} total'
color: ${{ env.BADGE_COLOR }}
path: badge-${{ env.BADGE_NAME }}.svg
- name: Upload badge to GH Action
uses: actions/upload-artifact@v7
with:
name: badge-${{ env.BADGE_NAME }}
path: badge-${{ env.BADGE_NAME }}.svg
- name: Checkout badges branch
if: steps.publish.outputs.badge
uses: actions/checkout@v6
with:
ref: badges
path: badges
- name: Upload badge to badges branch
if: steps.publish.outputs.badge
run: |
cd badges
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
cp ../badge-${{ env.BADGE_NAME }}.svg .
git add badge-${{ env.BADGE_NAME }}.svg
git commit -m "Update ${{ env.BADGE_NAME }} badge" || exit 0
git push -f