split out different Zig versions in CI to improve clarity when people… #201
Workflow file for this run
This file contains hidden or 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: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| concurrency: | ||
| # Cancels pending runs when a PR gets updated. | ||
| group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} | ||
| cancel-in-progress: true | ||
| env: | ||
| CI_JAVA_VERSION: 17 | ||
| # 35.0.0 = Android 15 | ||
| CI_ANDROID_SDK: "tools platform-tools platforms;android-35 build-tools;35.0.0 ndk;29.0.13113456" | ||
| jobs: | ||
| build-stable: | ||
| name: Build Zig Stable | ||
| strategy: | ||
| matrix: | ||
| max-parallel: 1 | ||
| include: | ||
| - os: "ubuntu-latest" | ||
| - os: "windows-latest" | ||
| - os: "macos-14" # arm64 as per table: https://github.com/actions/runner-images/blob/8a1eeaf6ac70c66f675a04078d1a7222edd42008/README.md#available-images | ||
| runs-on: ${{matrix.os}} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up JDK $CI_JAVA_VERSION | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: $CI_JAVA_VERSION | ||
| distribution: "temurin" | ||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
| with: | ||
| packages: "$CI_ANDROID_SDK" | ||
| - name: Setup Zig Stable | ||
| # note(jae): 2024-09-15 | ||
| # Uses download mirror first as preferred by Zig Foundation | ||
| # see: https://ziglang.org/news/migrate-to-self-hosting/ | ||
| uses: mlugg/setup-zig@v2 | ||
| - name: Build Minimal Example (Zig Stable) | ||
| run: zig build -Dandroid=true --verbose | ||
| working-directory: examples/minimal | ||
| - name: Build SDL2 Example (Zig Stable) | ||
| run: | | ||
| zig build -Dandroid=true --verbose | ||
| zig build -Dandroid=true -Dcrash-on-exception --verbose | ||
| working-directory: examples/sdl2 | ||
| - name: Build Raylib Example (Zig Stable) | ||
| run: zig build -Dandroid=true --verbose | ||
| working-directory: examples/raylib | ||
| # TODO(jae): 2025-03-30 | ||
| # Need to figure out how to get 'adb shell monkey' to return an error code or be able to return an error code | ||
| # if the stdout of the command has 'Monkey aborted due to error.' | ||
| # - name: Enable KVM (For Android emulation) | ||
| # if: startsWith(matrix.os, 'ubuntu-') | ||
| # run: | | ||
| # echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| # sudo udevadm control --reload-rules | ||
| # sudo udevadm trigger --name-match=kvm | ||
| # - name: Run Minimal Example (Android Emulator) | ||
| # if: startsWith(matrix.os, 'ubuntu-') | ||
| # uses: reactivecircus/android-emulator-runner@v2 | ||
| # with: | ||
| # api-level: 34 | ||
| # arch: x86_64 | ||
| # profile: Nexus 6 | ||
| # script: | | ||
| # adb install ./zig-out/bin/minimal.apk | ||
| # adb shell am start -S -W -n com.zig.minimal/android.app.NativeActivity | ||
| # working-directory: examples/minimal | ||
| # - name: Run SDL2 Example (Android Emulator) | ||
| # if: startsWith(matrix.os, 'ubuntu-') | ||
| # uses: reactivecircus/android-emulator-runner@v2 | ||
| # with: | ||
| # api-level: 34 | ||
| # arch: x86_64 | ||
| # profile: Nexus 6 | ||
| # script: | | ||
| # adb install ./zig-out/bin/sdl-zig-demo.apk | ||
| # adb shell monkey --kill-process-after-error --monitor-native-crashes --pct-touch 100 -p com.zig.sdl2 --throttle 1000 -v 2 | ||
| # working-directory: examples/sdl2 | ||
| build-nightly: | ||
| name: Build Zig Master (Latest Dev) | ||
| needs: build-stable | ||
| strategy: | ||
| max-parallel: 1 | ||
| matrix: | ||
| include: | ||
| - os: "ubuntu-latest" | ||
| - os: "windows-latest" | ||
| - os: "macos-14" # arm64 as per table: https://github.com/actions/runner-images/blob/8a1eeaf6ac70c66f675a04078d1a7222edd42008/README.md#available-images | ||
| runs-on: ${{matrix.os}} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up JDK $CI_JAVA_VERSION | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '$CI_JAVA_VERSION' | ||
| distribution: 'temurin' | ||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
| with: | ||
| # 35.0.0 = Android 15 | ||
| packages: "$CI_ANDROID_SDK" | ||
| - name: Setup Zig Nightly | ||
| uses: mlugg/setup-zig@v2 | ||
| with: | ||
| version: "master" | ||
| - name: Build Minimal Example (Zig Nightly) | ||
| run: zig build -Dandroid=true --verbose | ||
| working-directory: examples/minimal | ||
| - name: Build SDL2 Example (Zig Nightly) | ||
| run: zig build -Dandroid=true --verbose | ||
| working-directory: examples/sdl2 | ||
| # note(jae): 2026-01-10 | ||
| # Downstream packages for Raylib won't work with Zig 0.15.2 *and* Zig 0.16.X | ||
| # | ||
| # - name: Build Raylib Example (Zig Nightly) | ||
| # run: zig build -Dandroid=true --verbose | ||
| # working-directory: examples/raylib | ||
| build-previous: | ||
| name: Build Zig 0.14.0 (Previous Stable Release) | ||
| strategy: | ||
| matrix: | ||
| max-parallel: 1 | ||
| include: | ||
| - os: "ubuntu-latest" | ||
| - os: "windows-latest" | ||
| - os: "macos-14" # arm64 as per table: https://github.com/actions/runner-images/blob/8a1eeaf6ac70c66f675a04078d1a7222edd42008/README.md#available-images | ||
| runs-on: ${{matrix.os}} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up JDK $CI_JAVA_VERSION | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '$CI_JAVA_VERSION' | ||
| distribution: 'temurin' | ||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
| with: | ||
| # 35.0.0 = Android 15 | ||
| packages: "$CI_ANDROID_SDK" | ||
| # | ||
| # Previous Stable Zig Build | ||
| # | ||
| - name: Setup Zig Previous Stable (0.14.0) | ||
| uses: mlugg/setup-zig@v2 | ||
| with: | ||
| version: "0.14.0" | ||
| - name: Build Minimal Example (Zig Previous Stable) | ||
| run: zig build -Dandroid=true --verbose | ||
| working-directory: examples/minimal | ||
| - name: Build SDL2 Example (Zig Previous Stable) | ||
| run: zig build -Dandroid=true --verbose | ||
| working-directory: examples/sdl2 | ||