@@ -16,9 +16,22 @@ defaults:
16
16
shell : bash
17
17
18
18
jobs :
19
+ rustfmt :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - uses : actions/checkout@v2
23
+ - uses : actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f
24
+ with :
25
+ profile : minimal
26
+ toolchain : stable
27
+ components : rustfmt
28
+ - name : Checking rustfmt
29
+ run : cargo fmt --all -- --check;
30
+
19
31
clippy :
20
32
runs-on : ubuntu-latest
21
33
continue-on-error : ${{ matrix.experimental }}
34
+ needs : rustfmt
22
35
strategy :
23
36
matrix :
24
37
include :
@@ -35,35 +48,36 @@ jobs:
35
48
components : clippy
36
49
- run : cargo clippy --all --all-features -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
37
50
38
- rustfmt :
39
- runs-on : ubuntu-latest
40
- steps :
41
- - uses : actions/checkout@v2
42
- - uses : actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f
43
- with :
44
- profile : minimal
45
- toolchain : stable
46
- components : rustfmt
47
- - name : Checking rustfmt
48
- run : cargo fmt --all -- --check;
49
-
50
51
test :
51
52
continue-on-error : ${{ matrix.experimental }}
53
+ needs : rustfmt
52
54
strategy :
53
55
matrix :
54
56
include :
55
57
- rust : stable
56
58
os : ubuntu-latest
57
59
experimental : false
60
+ is_windows : false
58
61
- rust : nightly
59
62
os : ubuntu-latest
60
63
experimental : true
64
+ is_windows : false
65
+ - rust : stable
66
+ os : macos-latest
67
+ experimental : false
68
+ is_windows : false
69
+ - rust : nightly
70
+ os : macos-latest
71
+ experimental : true
72
+ is_windows : false
61
73
- rust : stable
62
74
os : windows-latest
63
75
experimental : false
76
+ is_windows : true
64
77
- rust : nightly
65
78
os : windows-latest
66
79
experimental : true
80
+ is_windows : true
67
81
runs-on : ${{ matrix.os }}
68
82
steps :
69
83
- uses : actions/checkout@v2
@@ -75,26 +89,68 @@ jobs:
75
89
with :
76
90
version : 10.0
77
91
directory : ${{ runner.temp }}/llvm
78
- - run : cargo test --all --all-features;
79
- # cargo test --target x86_64-pc-windows-msvc --all --all-features;
92
+ - name : Non-Windows test
93
+ if : ${{ !matrix.is_windows }}
94
+ run : cargo test --all --all-features;
95
+ - name : Non-Windows release build
96
+ if : ${{ !matrix.is_windows }}
97
+ run : cargo build --release;
98
+ - name : Windows test
99
+ if : ${{ matrix.is_windows }}
100
+ run : cargo test --target x86_64-pc-windows-msvc --all --all-features;
101
+ - name : Windows release build
102
+ if : ${{ matrix.is_windows }}
103
+ run : cargo build --target x86_64-pc-windows-msvc --release;
80
104
81
- build_release :
105
+ test_ios :
82
106
continue-on-error : ${{ matrix.experimental }}
107
+ needs : rustfmt
83
108
strategy :
84
109
matrix :
85
110
include :
86
111
- rust : stable
87
- os : ubuntu -latest
112
+ os : macos -latest
88
113
experimental : false
89
114
- rust : nightly
90
- os : ubuntu -latest
115
+ os : macos -latest
91
116
experimental : true
117
+ runs-on : ${{ matrix.os }}
118
+ steps :
119
+ - uses : actions/checkout@v2
120
+ - uses : actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f
121
+ with :
122
+ profile : minimal
123
+ toolchain : stable
124
+ - uses : KyleMayes/install-llvm-action@01144dc97b1e2693196c3056414a44f15180648b
125
+ with :
126
+ version : 10.0
127
+ directory : ${{ runner.temp }}/llvm
128
+ - name : Installing cargo-dinghy
129
+ run : |
130
+ rustup target add x86_64-apple-ios;
131
+ curl -L https://github.com/snipsco/dinghy/releases/download/cargo-dinghy%2F0.4.37/cargo-dinghy-macos.tgz -o cargo-dinghy-macos.tar.gz;
132
+ tar -zxvf cargo-dinghy-macos.tar.gz;
133
+ mkdir -p $HOME/.cargo/bin;
134
+ cp cargo-dinghy-macos/cargo-dinghy $HOME/.cargo/bin;
135
+ - run : |
136
+ RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1);
137
+ export SIM_ID=$(xcrun simctl create My-iphone11 com.apple.CoreSimulator.SimDeviceType.iPhone-11 $RUNTIME_ID);
138
+ xcrun simctl boot $SIM_ID;
139
+ cd gdnative-core;
140
+ cargo dinghy --platform auto-ios-x86_64 test;
141
+ cd ..;
142
+ cd gdnative-sys;
143
+ cargo dinghy --platform auto-ios-x86_64 test;
144
+
145
+ test_android :
146
+ continue-on-error : ${{ matrix.experimental }}
147
+ needs : rustfmt
148
+ strategy :
149
+ matrix :
150
+ include :
92
151
- rust : stable
93
- os : windows -latest
152
+ os : ubuntu -latest
94
153
experimental : false
95
- - rust : nightly
96
- os : windows-latest
97
- experimental : true
98
154
runs-on : ${{ matrix.os }}
99
155
steps :
100
156
- uses : actions/checkout@v2
@@ -106,11 +162,38 @@ jobs:
106
162
with :
107
163
version : 10.0
108
164
directory : ${{ runner.temp }}/llvm
109
- - run : cargo build --release;
110
- # cargo build --target x86_64-pc-windows-msvc --release;
165
+ - run : |
166
+ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64;
167
+ export ANDROID_SDK_ROOT=/opt/ndk/android-ndk-r21d;
168
+ # aarch64 and armv7 cover most Android phones & tablets.;
169
+ rustup target add aarch64-linux-android armv7-linux-androideabi;
170
+ sudo apt-get update;
171
+ sudo apt-get install openjdk-8-jdk;
172
+ sudo apt-get install llvm-dev libclang-dev clang g++-multilib gcc-multilib libc6-dev libc6-dev-arm64-cross;
173
+ # Downloading NDK. This file is huge (1Gb) maybe extract only what's needed and repackage.;
174
+ # See https://developer.android.com/ndk/downloads for updates.;
175
+ # The Android SDK which comes with Android Studio is not required. Only Java + NDK are.;
176
+ mkdir /opt/ndk
177
+ install -d /opt/ndk;
178
+ cd /opt/ndk && wget -nc -nv https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip && cd $GITHUB_WORKSPACE;
179
+ echo "bcf4023eb8cb6976a4c7cff0a8a8f145f162bf4d /opt/ndk/android-ndk-r21d-linux-x86_64.zip" >> /opt/ndk/SHA1SUM.txt;
180
+ sha1sum --check /opt/ndk/SHA1SUM.txt;
181
+ cd /opt/ndk && unzip -q android-ndk-r21d-linux-x86_64.zip && cd $GITHUB_WORKSPACE;
182
+ # Using clang linker from NDK when building Android programs.;
183
+ install -d $HOME/.cargo;
184
+ echo >> $HOME/.cargo/config;
185
+ echo "[target.aarch64-linux-android]" >> $HOME/.cargo/config;
186
+ find /opt/ndk -name aarch64-linux-android21-clang++ -printf 'linker = "%p"\n' >> $HOME/.cargo/config;
187
+ echo >> $HOME/.cargo/config;
188
+ echo "[target.armv7-linux-androideabi]" >> $HOME/.cargo/config;
189
+ find /opt/ndk -name armv7a-linux-androideabi21-clang++ -printf 'linker = "%p"\n' >> $HOME/.cargo/config;
190
+ echo >> $HOME/.cargo/config;
191
+ cargo build --target aarch64-linux-android --release;
192
+ cargo build --target armv7-linux-androideabi --release;
111
193
112
194
godot_test :
113
195
continue-on-error : ${{ matrix.experimental }}
196
+ needs : rustfmt
114
197
strategy :
115
198
matrix :
116
199
include :
@@ -165,7 +248,8 @@ jobs:
165
248
- clippy
166
249
- rustfmt
167
250
- test
168
- - build_release
251
+ - test_ios
252
+ - test_android
169
253
- godot_test
170
254
runs-on : ubuntu-latest
171
255
steps :
0 commit comments