-
Notifications
You must be signed in to change notification settings - Fork 35
192 lines (187 loc) · 6.43 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
name: CI
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
jobs:
ci:
name: CI
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [11, 17]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Checkout testsuite
uses: actions/checkout@v4
with:
repository: WebAssembly/testsuite
path: testsuite
# The ref needs to stay in sync with the default value in test-gen-plugin
ref: c2a67a575ddc815ff2212f68301d333e5e30a923
- name: Checkout wasi-testsuite
uses: actions/checkout@v4
with:
repository: WebAssembly/wasi-testsuite
path: wasi-testsuite
ref: prod/testsuite-base
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '${{ matrix.version }}'
cache: maven
- name: Check Style
run: mvn -B spotless:check -Pbenchmarks -Pfuzz
- name: Test Java
run: mvn -B clean install
- name: Verify that nightly fuzz compiles
run: mvn -B test -DskipTests -Pfuzz -pl fuzz
readme-ci:
runs-on: ubuntu-latest
name: CI - Readme
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: maven
- name: Build Chicory
run: mvn -Dquickly
env:
MAVEN_OPTS: "-Dmaven.repo.local=${{ github.workspace }}/repository"
# Test root Readme
- name: jbang
uses: jbangdev/jbang-action@9f8c55e0a2b6b297711162b20c209c5e07076e59 # tag=v0.117.1
with:
script: README.md
env:
JBANG_REPO: "${{ github.workspace }}/repository"
- name: compare results
run: diff -r ./readmes/main/expected ./readmes/main/current
# Test wasi Readme
- name: jbang
uses: jbangdev/jbang-action@9f8c55e0a2b6b297711162b20c209c5e07076e59 # tag=v0.117.1
with:
script: wasi/README.md
env:
JBANG_REPO: "${{ github.workspace }}/repository"
- name: compare results
run: diff -r ./readmes/wasi/expected ./readmes/wasi/current
# Test AOT Readme
- name: jbang
uses: jbangdev/jbang-action@9f8c55e0a2b6b297711162b20c209c5e07076e59 # tag=v0.117.1
with:
script: aot/README.md
env:
JBANG_REPO: "${{ github.workspace }}/repository"
test-results:
name: Test Results
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
folder: [runtime-tests, aot, wasi]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Checkout testsuite
uses: actions/checkout@v4
with:
repository: WebAssembly/testsuite
path: testsuite
# The ref needs to stay in sync with the default value in test-gen-plugin
ref: c2a67a575ddc815ff2212f68301d333e5e30a923
- name: Checkout wasi-testsuite
uses: actions/checkout@v4
with:
repository: WebAssembly/wasi-testsuite
path: wasi-testsuite
ref: prod/testsuite-base
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: maven
- name: Test Java
run: mvn -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
;;
aot)
echo "NAME=AOT" >> $GITHUB_ENV
echo "BADGE_NAME=aot" >> $GITHUB_ENV
;;
wasi)
echo "NAME=WASI" >> $GITHUB_ENV
echo "BADGE_NAME=wasi" >> $GITHUB_ENV
;;
esac
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
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@808173dd03e2f30c980d03ee49e181626088eee8
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@v4
with:
name: badge-${{ env.BADGE_NAME }}
path: badge-${{ env.BADGE_NAME }}.svg
- name: Upload badge to Gist
if: steps.publish.outputs.badge
uses: andymckay/append-gist-action@ab30bf28df67017c7ad696500b218558c7c04db3
with:
token: ${{ secrets.GIST_TOKEN }}
gistURL: https://gist.githubusercontent.com/andreaTP/69354d1cc6cf23e4c3c4a9a8daf7ea15
file: badge-${{ env.BADGE_NAME }}.svg