@@ -4,44 +4,182 @@ name: CI
4
4
on : [push, pull_request]
5
5
jobs :
6
6
lint :
7
- name : jt lint + jt test fast
7
+ name : lint
8
8
runs-on : ubuntu-20.04
9
9
steps :
10
10
- name : Clone TruffleRuby
11
11
uses : actions/checkout@v2
12
12
- name : Setup system Ruby
13
13
uses : ruby/setup-ruby@v1
14
+ - name : Setup jt
15
+ run : echo "$PWD/bin" >> $GITHUB_PATH
14
16
15
17
- name : Restore ~/.mx/cache
16
18
uses : actions/cache@v2
17
19
with :
18
20
path : ~/.mx/cache
19
- key : mx-cache-${{ runner.os }}-${{ hashFiles('common.json') }}
20
-
21
- - name : Install Eclipse
22
- run : tool/jt.rb install eclipse
23
- - name : Install JVMCI
24
- run : tool/jt.rb install jvmci
25
- - name : Set JAVA_HOME
26
- run : echo "JAVA_HOME=$(tool/jt.rb install jvmci)" >> $GITHUB_ENV
27
- - name : Clone mx
28
- run : tool/jt.rb mx --version
29
- - name : Clone Graal
30
- run : tool/jt.rb mx sforceimports
21
+ key : mx-cache-lint-${{ runner.os }}-${{ hashFiles('common.json') }}
31
22
32
- - name : Build TruffleRuby
33
- run : tool/jt.rb build
23
+ - uses : ./.github/actions/setup-jvmci-graal
34
24
25
+ - run : jt install eclipse
35
26
- name : Install RuboCop
36
27
run : gem install --no-document rubocop:0.66.0
37
- - name : jt lint
38
- run : tool/jt.rb lint
28
+ - run : jt lint
29
+ - run : jt spotbugs
30
+
31
+ build :
32
+ name : build jvm
33
+ runs-on : ubuntu-20.04
34
+ defaults :
35
+ run :
36
+ # Ensure all build files are in build/.
37
+ # Test jobs don't have build/ to ensure nothing uses the build files.
38
+ working-directory : build
39
+ steps :
40
+ - name : Clone TruffleRuby
41
+ uses : actions/checkout@v2
42
+ with :
43
+ path : build
44
+ - name : Setup system Ruby
45
+ uses : ruby/setup-ruby@v1
46
+ with :
47
+ working-directory : build
48
+ - name : Setup jt
49
+ run : echo "$PWD/bin" >> $GITHUB_PATH
50
+
51
+ - name : Restore ~/.mx/cache
52
+ uses : actions/cache@v2
53
+ with :
54
+ path : ~/.mx/cache
55
+ key : mx-cache-build-${{ runner.os }}-${{ hashFiles('build/common.json') }}
56
+
57
+ - uses : ./build/.github/actions/setup-jvmci-graal
58
+
59
+ - name : Build TruffleRuby
60
+ run : jt build
61
+
62
+ - name : Create archive
63
+ run : tar cf truffleruby-jvm.tar truffleruby-jvm
64
+ working-directory : build/mxbuild
65
+ - uses : actions/upload-artifact@v2
66
+ with :
67
+ name : truffleruby-jvm
68
+ path : build/mxbuild/truffleruby-jvm.tar
69
+
70
+ build_native :
71
+ name : build native
72
+ runs-on : ubuntu-20.04
73
+ defaults :
74
+ run :
75
+ # Ensure all build files are in build/.
76
+ # Test jobs don't have build/ to ensure nothing uses the build files.
77
+ working-directory : build
78
+ steps :
79
+ - name : Clone TruffleRuby
80
+ uses : actions/checkout@v2
81
+ with :
82
+ path : build
83
+ - name : Setup system Ruby
84
+ uses : ruby/setup-ruby@v1
85
+ with :
86
+ working-directory : build
87
+ - name : Setup jt
88
+ run : echo "$PWD/bin" >> $GITHUB_PATH
89
+
90
+ - name : Restore ~/.mx/cache
91
+ uses : actions/cache@v2
92
+ with :
93
+ path : ~/.mx/cache
94
+ key : mx-cache-build-native-${{ runner.os }}-${{ hashFiles('build/common.json') }}
95
+
96
+ - uses : ./build/.github/actions/setup-jvmci-graal
97
+
98
+ - name : Build TruffleRuby
99
+ run : jt build --env native
100
+
101
+ - name : Create archive
102
+ run : tar cf truffleruby-native.tar truffleruby-native
103
+ working-directory : build/mxbuild
104
+ - uses : actions/upload-artifact@v2
105
+ with :
106
+ name : truffleruby-native
107
+ path : build/mxbuild/truffleruby-native.tar
108
+
109
+ fast_specs :
110
+ name : fast specs
111
+ needs : [build]
112
+ runs-on : ubuntu-20.04
113
+ steps :
114
+ - name : Clone TruffleRuby
115
+ uses : actions/checkout@v2
116
+ - name : Setup system Ruby
117
+ uses : ruby/setup-ruby@v1
118
+ - name : Setup jt
119
+ run : echo "SYSTEM_RUBY=$(which ruby)" >> $GITHUB_ENV && echo "$PWD/bin" >> $GITHUB_PATH
120
+
121
+ - uses : actions/download-artifact@v2
122
+ with :
123
+ name : truffleruby-jvm
124
+ - uses : ./.github/actions/setup-truffleruby
125
+
126
+ - run : jt test fast
127
+ - run : jt test :next
128
+
129
+ all_specs :
130
+ name : specs ${{ matrix.specs }}
131
+ needs : [build]
132
+ runs-on : ubuntu-20.04
133
+ strategy :
134
+ fail-fast : false
135
+ matrix :
136
+ specs :
137
+ - :truffle # ~12min
138
+ - :language :core # ~3min + ~9min
139
+ - :library :cext :security :command_line # command_line ~5min, others < 2min
140
+ steps :
141
+ - name : Clone TruffleRuby
142
+ uses : actions/checkout@v2
143
+ - name : Setup system Ruby
144
+ uses : ruby/setup-ruby@v1
145
+ - name : Setup jt
146
+ run : echo "SYSTEM_RUBY=$(which ruby)" >> $GITHUB_ENV && echo "$PWD/bin" >> $GITHUB_PATH
147
+
148
+ - uses : actions/download-artifact@v2
149
+ with :
150
+ name : truffleruby-jvm
151
+ - uses : ./.github/actions/setup-truffleruby
152
+
153
+ - run : jt test --timeout 180 ${{ matrix.specs }}
154
+
155
+ test_native :
156
+ name : test native
157
+ needs : [build_native]
158
+ runs-on : ubuntu-20.04
159
+ steps :
160
+ - name : Clone TruffleRuby
161
+ uses : actions/checkout@v2
162
+ - name : Setup system Ruby
163
+ uses : ruby/setup-ruby@v1
164
+ - name : Setup jt
165
+ run : echo "SYSTEM_RUBY=$(which ruby)" >> $GITHUB_ENV && echo "$PWD/bin" >> $GITHUB_PATH
166
+
167
+ - uses : actions/download-artifact@v2
168
+ with :
169
+ name : truffleruby-native
170
+ - uses : ./.github/actions/setup-truffleruby
171
+ with :
172
+ archive : truffleruby-native
39
173
40
- - name : jt test fast
41
- run : tool/jt.rb test fast
174
+ - run : jt test compiler
175
+ # A subset of specs that are more likely to differ on native and run quickly
176
+ - run : jt test :command_line
177
+ - run : jt test :language
178
+ # To catch slow :truffle specs which only apply to native
179
+ - run : jt test fast :truffle
42
180
43
- mri_specs :
44
- name : Run ruby/spec on CRuby ${{ matrix.ruby }}
181
+ ruby_spec_cruby :
182
+ name : ruby/spec on CRuby ${{ matrix.ruby }}
45
183
strategy :
46
184
fail-fast : false
47
185
matrix :
53
191
with :
54
192
ruby-version : ${{ matrix.ruby }}
55
193
bundler : none
56
- - run : CHECK_LEAKS=true tool/jt.rb -u ruby mspec -fdot --timeout 30 spec/ruby
194
+ - name : Setup jt
195
+ run : echo "$PWD/bin" >> $GITHUB_PATH
196
+ - run : CHECK_LEAKS=true jt -u ruby mspec -fdot --timeout 30 spec/ruby
0 commit comments