-
Notifications
You must be signed in to change notification settings - Fork 13
170 lines (164 loc) · 5.24 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
name: CI
on:
push:
branches: [main]
paths:
- '.github/workflows/ci.yml'
- '**.rs'
- '**.toml'
pull_request:
paths:
- '.github/workflows/ci.yml'
- '**.rs'
- '**.toml'
jobs:
android-build-ubuntu:
name: Build Android example on Ubuntu latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Android targets and upgrade rust
run: |
rustup upgrade
rustup target add aarch64-linux-android x86_64-linux-android
- name: Install Crossbundle
run: cargo install --path=./crossbundle/cli
- name: Build APK
# Temporary workaround: https://github.com/actions/virtual-environments/issues/5879#issuecomment-1195156618
run: |
cd examples/macroquad-3d
export ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME
crossbundle build android -s=native-apk --release
android-build-windows:
name: Build Android example on Windows latest
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Install Android targets and upgrade rust
run: |
rustup upgrade
rustup target add aarch64-linux-android x86_64-linux-android
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 11
- name: Install Crossbundle
run: |
cargo install --path=./crossbundle/cli
crossbundle install --preferred
- name: Build APK
run: |
cd examples/macroquad-permissions
setx ANDROID_SDK_ROOT "$HOME/AppData/Local/Android/Sdk" /M
setx ANDROID_NDK_ROOT "$HOME/AppData/Local/Android/Sdk/ndk/23.1.7779620" /M
crossbundle build android --release
apple-build-macos:
name: Build Apple example on macOS latest
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- name: Install Apple targets
run: rustup target add aarch64-apple-ios
- name: Install Crossbundle
run: |
rustup upgrade
cargo install --path=./crossbundle/cli
- name: Build Apple app
run: |
cd examples/macroquad-3d
crossbundle build ios --release --target=aarch64-apple-ios
test-crossbundle-new:
name: Generate and Build from template on macOS latest
runs-on: macos-latest
if: false
steps:
- uses: actions/checkout@master
- name: Install Android targets
run: |
# Workaround for "detected conflict" error:
rustup toolchain remove stable-x86_64-apple-darwin
rustup install stable-x86_64-apple-darwin
rustup target add aarch64-linux-android x86_64-linux-android
- name: Install Crossbundle
run: |
brew install [email protected] cmake
cargo install cargo-generate
cargo install --path=./crossbundle/cli
- name: Generate project
run: |
cd ~
crossbundle new example --template=quad
- name: Build Apple app
run: |
cd ~/example/
crossbundle build android -s=native-apk --release
build-example-in-docker:
name: Build Crossbundle Example from Docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Crossbundle image
run: docker build -t tmp -f .github/docker/crossbundle.Dockerfile .
- name: Build Crossbundle Example
run: |
docker run --rm -v "$(pwd)/:/src" -w /src/examples/macroquad-permissions tmp build android --release
clean:
name: Check code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
override: true
- name: Check the format
run: |
cd crossbundle/cli/
cargo +nightly fmt --all -- --check
- name: Run clippy
run: |
cd crossbundle/cli/
cargo clippy --all-targets --all-features -- -D warnings -A clippy::unnecessary-unwrap -A clippy::too-many-arguments
- name: Check for deadlinks
run: |
cargo install cargo-deadlinks
cargo deadlinks --check-http
run-tests:
name: Run tests
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 11
- name: Install gradle
uses: gradle/gradle-build-action@v2
with:
distribution: temurin
gradle-version: 7.4
- name: Install Apple targets
run: |
rustup upgrade
rustup target add aarch64-apple-ios x86_64-apple-ios
- name: Install Android targets
run: |
rustup upgrade
rustup target add aarch64-linux-android x86_64-linux-android
- name: Install bundletool
run: |
wget https://github.com/google/bundletool/releases/download/1.8.2/bundletool-all-1.8.2.jar
mv bundletool-all-1.8.2.jar $HOME/bundletool.jar
- name: Run all tests
run: |
export BUNDLETOOL_PATH="$HOME/bundletool.jar"
cargo test --all --no-fail-fast