Fix zip issue on windows, bump packages versions #775
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |