-
Notifications
You must be signed in to change notification settings - Fork 14
210 lines (204 loc) · 9.59 KB
/
ci.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
name: Test TruffleSqueak
on:
push:
branches-ignore:
- 'experiements/**'
paths-ignore:
- '**.md'
- 'docs/**'
- gu-catalog.properties
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
- gu-catalog.properties
workflow_dispatch:
env:
VERBOSE_GRAALVM_LAUNCHERS: true
MX_GATE_OPTS: '--strict-mode --omit-clean'
jobs:
style_and_build_config:
name: style and fullbuild
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- name: Clone TruffleSqueak repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Set up dependencies
run: |
# Download Eclipse SDK
eclipse_tar_path="${RUNNER_TEMP}/eclipse.tar.gz"
wget --no-verbose https://archive.eclipse.org/eclipse/downloads/drops4/R-4.26-202211231800/eclipse-SDK-4.26-linux-gtk-x86_64.tar.gz -O ${eclipse_tar_path}
tar -xzf ${eclipse_tar_path} -C ${RUNNER_TEMP}
echo "ECLIPSE_EXE=${RUNNER_TEMP}/eclipse/eclipse" >> "${GITHUB_ENV}" # required by mx
# Set up mx, oracle/graal, and LabsJDK21
mx.trufflesqueak/utils.sh "set-up-mx && shallow-clone-graal && set-up-labsjdk labsjdk-ce-21 ~/"
# Set up style dependencies
sudo apt update && sudo apt install python3-pip python-setuptools
jq -r '.pip | to_entries[] | .key+.value' ../graal/common.json | xargs sudo pip install
- name: Check style and perform full build
run: mx gate ${{ env.MX_GATE_OPTS }} --tags style,fullbuild
build-jar:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-20.04-aarch64, macos-11, windows-2022]
java: [21]
env:
RUN_WITH_COVERAGE: "${{ matrix.os == 'ubuntu-20.04' }}"
MX_ENV: "trufflesqueak-jar"
name: jar ${{ matrix.os }} + JDK${{ matrix.java }}
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Clone TruffleSqueak repository
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Set up dependencies
shell: bash
run: mx.trufflesqueak/utils.sh set-up-dependencies java${{ matrix.java }} jar
- name: Build GraalVM with TruffleSqueak
run: mx.trufflesqueak/utils.sh build-graalvm ${{ matrix.java }}
if: ${{ runner.os != 'Windows' }}
- name: Build GraalVM with TruffleSqueak via cmd.exe
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
call mx --env ${{ env.MX_ENV }} --no-download-progress build --dependencies GRAALVM_TRUFFLESQUEAK_JAR_JAVA${{ matrix.java }}
call mx --env ${{ env.MX_ENV }} graalvm-home > graalvm-home-with-forward-slashes.txt
set /p GRAALVM_HOME=<graalvm-home-with-forward-slashes.txt
setlocal enabledelayedexpansion
set "GRAALVM_HOME=%GRAALVM_HOME:/=\%"
echo %GRAALVM_HOME%\bin>>%GITHUB_PATH%
echo GRAALVM_HOME=%GRAALVM_HOME%>>%GITHUB_ENV%
echo [%GRAALVM_HOME% set as $GRAALVM_HOME]
if: ${{ runner.os == 'Windows' }}
- name: Publish TruffleSqueak packages to GitHub Packages
shell: bash
run: |
sed "s/{USERNAME}/${GITHUB_ACTOR}/g; s/{TOKEN}/${{ secrets.GITHUB_TOKEN }}/g" mx.trufflesqueak/mvn-settings.xml.template > mx.trufflesqueak/mvn-settings.xml
mx --env trufflesqueak-jar maven-deploy --settings mx.trufflesqueak/mvn-settings.xml --version-string 24.0.0-dev --validate full --licenses MIT --suppress-javadoc github https://maven.pkg.github.com/hpi-swa/trufflesqueak
if: ${{ matrix.os == 'ubuntu-20.04' }}
- name: Run SystemReporter on TruffleSqueak
run: 'trufflesqueak --code "(String streamContents: [:s | SystemReporter basicNew reportImage: s; reportVM: s; reportVMParameters: s]) withUnixLineEndings" images/test-64bit.image'
- name: Clone Graal.js repository
shell: bash
run: mx.trufflesqueak/utils.sh shallow-clone-graaljs
- name: Run gate with Graal compiler and Graal.js
run: mx --disable-polyglot --dy /compiler,/graal-js gate ${{ env.MX_GATE_OPTS }} --tags build,test
if: ${{ runner.os != 'Windows' && env.RUN_WITH_COVERAGE != 'true' }}
- name: Run gate with Graal.js and code coverage # do not use Graal compiler with JaCoCo code coverage
run: mx --disable-polyglot --dy /graal-js gate ${{ env.MX_GATE_OPTS }} --tags build,test --jacocout coverage
if: ${{ runner.os != 'Windows' && env.RUN_WITH_COVERAGE == 'true' }}
- name: Run gate with Graal compiler and Graal.js via cmd.exe
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
mx --disable-polyglot --dy /compiler,/graal-js gate ${{ env.MX_GATE_OPTS }} --tags build,test
if: ${{ runner.os == 'Windows' }}
- name: Report code coverage
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
bash <(curl -s https://codecov.io/bash)
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r jacoco.xml
if: ${{ env.RUN_WITH_COVERAGE == 'true' && job.status == 'success' }}
- name: Zip Graal compiler dumps
if: always()
shell: bash
run: "[[ -d graal_dumps ]] && zip -r graal_dumps.zip graal_dumps || true"
- name: Upload Graal compiler dumps
if: always()
uses: actions/upload-artifact@v3
with:
name: graal_dumps
path: graal_dumps.zip
if-no-files-found: ignore
retention-days: 5
build-standalone:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-20.04-aarch64, windows-2022, macos-11]
type: [native, jvm]
env:
JAVA_VERSION: "21"
MX_ENV: "trufflesqueak-${{ matrix.type }}"
VERBOSE_GRAALVM_LAUNCHERS: true
name: ${{ matrix.type }} ${{ matrix.os }}
timeout-minutes: 30
runs-on: ${{ matrix.os }}
steps:
- name: Clone TruffleSqueak repository
uses: actions/checkout@v3
- name: Set up Oracle GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.type == 'native' }}
- name: Enable Oracle GraalVM
shell: bash
run: |
echo "EXTRA_GRAALVM_HOME=$JAVA_HOME" >> $GITHUB_ENV
cat "${JAVA_HOME}/LICENSE.txt" > "${GITHUB_WORKSPACE}/LICENSE"
if: ${{ matrix.type == 'native' }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Set up dependencies
shell: bash
run: mx.trufflesqueak/utils.sh set-up-dependencies java${{ env.JAVA_VERSION }} ${{ matrix.type }}
- name: Build TruffleSqueak standalone
run: mx.trufflesqueak/utils.sh build-standalone ${{ matrix.type }} ${{ env.JAVA_VERSION }}
if: ${{ runner.os != 'Windows' }}
- name: Build TruffleSqueak standalone via cmd.exe
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
if ${{ matrix.type }}==native (set "DEPENDENCY_NAME=SMALLTALK_NATIVE_STANDALONE_SVM_JAVA${{ env.JAVA_VERSION }}") else (set "DEPENDENCY_NAME=SMALLTALK_JAVA_STANDALONE_SVM_JAVA${{ env.JAVA_VERSION }}")
call mx --env ${{ env.MX_ENV }} --no-download-progress build --dependencies %DEPENDENCY_NAME%
call mx --env ${{ env.MX_ENV }} standalone-home --type ${{ matrix.type }} smalltalk > standalone-home-with-forward-slashes.txt
set /p STANDALONE_HOME=<standalone-home-with-forward-slashes.txt
setlocal enabledelayedexpansion
set "STANDALONE_HOME=%STANDALONE_HOME:/=\%"
echo %STANDALONE_HOME%\bin>>%GITHUB_PATH%
echo [%STANDALONE_HOME%\bin added to $PATH]
call mx --env ${{ env.MX_ENV }} paths %DEPENDENCY_NAME% > standalone-path-with-forward-slashes.txt
set /p STANDALONE_PATH=<standalone-path-with-forward-slashes.txt
setlocal enabledelayedexpansion
set "STANDALONE_PATH=%STANDALONE_PATH:/=\%"
copy %STANDALONE_PATH% ${{ env.STANDALONE_TARGET }}
if: ${{ runner.os == 'Windows' }}
- name: Run SystemReporter on TruffleSqueak standalone
run: 'trufflesqueak --code "(String streamContents: [:s | SystemReporter basicNew reportImage: s; reportVM: s; reportVMParameters: s]) withUnixLineEndings" images/test-64bit.image'
- name: Upload TruffleSqueak standalone
uses: actions/upload-artifact@v3
with:
name: trufflesqueak-${{ matrix.type }}-${{ matrix.os }}
path: ${{ env.STANDALONE_TARGET }}
retention-days: 7
- name: Deploy TruffleSqueak standalone
shell: bash
run: mx.trufflesqueak/utils.sh deploy-asset ${{ env.STANDALONE_TARGET }} ${{ secrets.GITHUB_TOKEN }}
# GraalVM Native Image does not support AWT on macOS yet (https://github.com/oracle/graal/issues/4921)
if: ${{ matrix.type == 'jvm' || runner.os != 'macOS' }}
- name: Run Cuis-Smalltalk tests on TruffleSqueak standalone
run: |
mx.trufflesqueak/utils.sh download-cuis-test-image
trufflesqueak --vm.ea --vm.esa --headless --experimental-options --smalltalk.resource-summary=true --compiler.TreatPerformanceWarningsAsErrors=call,instanceof,store,trivial --engine.CompilationFailureAction=ExitVM --engine.CompilationStatistics images/Cuis6.0-????.image -s src/de.hpi.swa.trufflesqueak.test/src/de/hpi/swa/trufflesqueak/test/runCuisTests.st
timeout-minutes: 10
if: ${{ matrix.os == 'ubuntu-20.04' }}