32
32
33
33
# Local variables
34
34
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
35
- GODOT_VER : " 3.4"
36
- GODOT_REL : stable
35
+ GDRUST_FEATURES : " gdnative/async,gdnative/serde"
37
36
38
37
on :
39
38
push :
@@ -50,11 +49,11 @@ jobs:
50
49
runs-on : ubuntu-latest
51
50
steps :
52
51
- uses : actions/checkout@v2
53
- - name : Install Rust
52
+ - name : " Install Rust"
54
53
uses : ./.github/composite/rust
55
54
with :
56
55
components : rustfmt
57
- - name : Check rustfmt
56
+ - name : " Check rustfmt"
58
57
run : cargo fmt --all -- --check;
59
58
60
59
clippy :
@@ -71,13 +70,13 @@ jobs:
71
70
postfix : ' (nightly)'
72
71
steps :
73
72
- uses : actions/checkout@v2
74
- - name : Install Rust
73
+ - name : " Install Rust"
75
74
uses : ./.github/composite/rust
76
75
with :
77
76
rust : ${{ matrix.rust.toolchain }}
78
77
components : clippy
79
- - name : Check clippy
80
- run : cargo clippy --workspace --all- features -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
78
+ - name : " Check clippy"
79
+ run : cargo clippy --workspace --features ${GDRUST_FEATURES} -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
81
80
82
81
test :
83
82
name : test-${{ matrix.os.name }}${{ matrix.rust.postfix }}
@@ -106,22 +105,22 @@ jobs:
106
105
- rust : { toolchain: 'nightly' }
107
106
testflags : ' -- --skip ui_tests'
108
107
- os : { id: ubuntu-latest, name: linux }
109
- rust : { toolchain: '1.48 ', postfix: ' (msrv 1.48 )' }
108
+ rust : { toolchain: '1.51 ', postfix: ' (msrv 1.51 )' }
110
109
testflags : ' -- --skip ui_tests'
111
110
runs-on : ${{ matrix.os.id }}
112
111
steps :
113
112
- uses : actions/checkout@v2
114
- - name : Install Rust
113
+ - name : " Install Rust"
115
114
uses : ./.github/composite/rust
116
115
with :
117
116
rust : ${{ matrix.rust.toolchain }}
118
- - name : Install LLVM
117
+ - name : " Install LLVM"
119
118
uses : ./.github/composite/llvm
120
119
if : ${{ matrix.os.id == 'windows-latest' }}
121
- - name : Compile tests
122
- run : cargo test --workspace --all- features --no-run;
123
- - name : Test
124
- run : cargo test --workspace --all- features ${{ matrix.testflags }};
120
+ - name : " Compile tests"
121
+ run : cargo test --workspace --features ${GDRUST_FEATURES} --no-run;
122
+ - name : " Test"
123
+ run : cargo test --workspace --features ${GDRUST_FEATURES} ${{ matrix.testflags }};
125
124
126
125
build-release :
127
126
name : build-release-${{ matrix.os.name }}
@@ -139,14 +138,14 @@ jobs:
139
138
runs-on : ${{ matrix.os.id }}
140
139
steps :
141
140
- uses : actions/checkout@v2
142
- - name : Install Rust
141
+ - name : " Install Rust"
143
142
uses : ./.github/composite/rust
144
143
with :
145
144
rust : stable
146
- - name : Install LLVM
145
+ - name : " Install LLVM"
147
146
uses : ./.github/composite/llvm
148
147
if : ${{ matrix.os.id == 'windows-latest' }}
149
- - name : Release build (check only)
148
+ - name : " Release build (check only)"
150
149
run : cargo check --release;
151
150
152
151
build-ios :
@@ -158,18 +157,18 @@ jobs:
158
157
runs-on : macos-latest
159
158
steps :
160
159
- uses : actions/checkout@v2
161
- - name : Install Rust
160
+ - name : " Install Rust"
162
161
uses : ./.github/composite/rust
163
162
# with:
164
163
# rust: ${{ matrix.rust.toolchain }}
165
- - name : Install cargo-dinghy
164
+ - name : " Install cargo-dinghy"
166
165
run : |
167
166
rustup target add x86_64-apple-ios;
168
167
curl -L https://github.com/sonos/dinghy/releases/download/0.4.62/cargo-dinghy-macos-0.4.62.tgz -o cargo-dinghy-macos.tar.gz;
169
168
tar -zxvf cargo-dinghy-macos.tar.gz;
170
169
mkdir -p $HOME/.cargo/bin;
171
170
cp cargo-dinghy-0.4.62/cargo-dinghy $HOME/.cargo/bin;
172
- - name : Cross-compile to iOS
171
+ - name : " Cross-compile to iOS"
173
172
run : |
174
173
RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1);
175
174
export SIM_ID=$(xcrun simctl create My-iphone11 com.apple.CoreSimulator.SimDeviceType.iPhone-11 $RUNTIME_ID);
@@ -190,11 +189,11 @@ jobs:
190
189
runs-on : ubuntu-latest
191
190
steps :
192
191
- uses : actions/checkout@v2
193
- - name : Install Rust
192
+ - name : " Install Rust"
194
193
uses : ./.github/composite/rust
195
194
# with:
196
195
# rust: ${{ matrix.rust.toolchain }}
197
- - name : Install Java + NDK
196
+ - name : " Install Java + NDK"
198
197
run : |
199
198
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64;
200
199
export ANDROID_SDK_ROOT=/opt/ndk/android-ndk-r21d;
@@ -227,65 +226,42 @@ jobs:
227
226
cargo build --target armv7-linux-androideabi --release;
228
227
229
228
integration-test-godot :
230
- name : itest-godot${{ matrix.rust .postfix }}
229
+ name : itest-godot- ${{ matrix.godot }}${{ matrix .postfix }}
231
230
needs : rustfmt
232
231
continue-on-error : ${{ matrix.rust.toolchain == 'nightly' }}
233
232
strategy :
233
+ fail-fast : false # cancel all jobs as soon as one fails?
234
234
matrix :
235
- rust :
236
- - toolchain : stable
235
+ include :
236
+ # Latest Godot with different Rust versions
237
+ - rust : stable
238
+ godot : " 3.4.1"
237
239
postfix : ' '
238
- - toolchain : nightly
240
+ - rust : nightly
241
+ godot : " 3.4.1"
239
242
postfix : ' (nightly)'
240
- - toolchain : ' 1.48'
241
- postfix : ' (msrv 1.48)'
243
+ - rust : ' 1.51'
244
+ godot : " 3.4.1"
245
+ postfix : ' (msrv 1.51)'
246
+
247
+ # Test with older engine version
248
+ # Note: headless versions of Godot <= 3.3 may crash with a bug, see feature description in lib.rs
249
+ - rust : stable
250
+ godot : " 3.3.1"
251
+ postfix : ' '
252
+ build_args : ' --features custom-godot'
253
+
242
254
runs-on : ubuntu-latest
243
255
steps :
244
256
- uses : actions/checkout@v2
245
- - name : Install Rust
246
- uses : ./.github/composite/rust
257
+ - name : " Run Godot integration test "
258
+ uses : ./.github/composite/godot
247
259
with :
248
- rust : ${{ matrix.rust.toolchain }}
249
- - name : Check cache for installed Godot version
250
- id : cache-godot
251
- uses : actions/cache@v2
252
- with :
253
- path : ${{ runner.temp }}/godot_bin
254
- key : godot-${{ runner.os }}-v${{ env.GODOT_VER }}-${{ env.GODOT_REL }}
255
- - name : Install Godot
256
- if : steps.cache-godot.outputs.cache-hit != 'true'
257
- run : |
258
- wget "https://downloads.tuxfamily.org/godotengine/$GODOT_VER/Godot_v${GODOT_VER}-${GODOT_REL}_linux_headless.64.zip" -O /tmp/godot.zip
259
- unzip /tmp/godot.zip -d ${{ runner.temp }}/godot_bin
260
- - name : Build godot-rust
261
- run : |
262
- cd test;
263
- cargo build;
264
- - name : Run Godot integration tests
265
- run : |
266
- cd test;
267
- mkdir -p ./project/lib;
268
- cp ../target/debug/libgdnative_test.so ./project/lib/;
269
- "${{ runner.temp }}/godot_bin/Godot_v${GODOT_VER}-${GODOT_REL}_linux_headless.64" --path ./project/ > >(tee "${{ runner.temp }}/stdout.log");
270
- if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then
271
- exit 1;
272
- fi;
273
- "${{ runner.temp }}/godot_bin/Godot_v${GODOT_VER}-${GODOT_REL}_linux_headless.64" -e --path ./project/ --run-editor-tests > >(tee "${{ runner.temp }}/stdout.log");
274
- if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then
275
- exit 1;
276
- fi;
277
- cargo build --features=type_tag_fallback;
278
- mkdir -p ./project/lib;
279
- cp ../target/debug/libgdnative_test.so ./project/lib/;
280
- "${{ runner.temp }}/godot_bin/Godot_v${GODOT_VER}-${GODOT_REL}_linux_headless.64" --path ./project/ > >(tee "${{ runner.temp }}/stdout.log");
281
- if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then
282
- exit 1;
283
- fi;
284
- "${{ runner.temp }}/godot_bin/Godot_v${GODOT_VER}-${GODOT_REL}_linux_headless.64" -e --path ./project/ --run-editor-tests > >(tee "${{ runner.temp }}/stdout.log");
285
- if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then
286
- exit 1;
287
- fi;
288
-
260
+ rust_toolchain : ${{ matrix.rust }}
261
+ rust_extra_args : ${{ matrix.build_args }}
262
+ godot_ver : ${{ matrix.godot }}
263
+
264
+
289
265
# This job doesn't actually test anything, but is used to tell bors that the build completed,
290
266
# as there is no practical way to detect when a workflow is successful, listening to webhooks only.
291
267
# The ID (not name) of this job is the one referenced in bors.toml.
@@ -303,5 +279,5 @@ jobs:
303
279
- build-android
304
280
runs-on : ubuntu-latest
305
281
steps :
306
- - name : Mark the job as a success
282
+ - name : " Mark the job as a success"
307
283
run : exit 0
0 commit comments