feat: Add determinism test #10
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: Build Workflow | |
on: [push, pull_request] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install cross-compilation toolchains | |
run: | | |
sudo apt update | |
sudo apt install -y --force-yes gcc g++ | |
sudo apt install -y --force-yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross | |
sudo apt install -y --force-yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross | |
sudo apt install -y --force-yes gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross | |
sudo apt install -y --force-yes mingw-w64 lib32z1 | |
- name: Download Android NDK | |
run: | | |
mkdir -p $HOME/android-ndk | |
cd $HOME/android-ndk | |
wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip -O android-ndk.zip | |
echo "769ee342ea75f80619d985c2da990c48b3d8eaf45f48783a2d48870d04b46108 android-ndk.zip" | sha256sum --check | |
unzip android-ndk.zip | |
echo "NDK_HOME=$HOME/android-ndk/android-ndk-r25c" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Build box2d | |
run: ./gradlew build_linux build_android build_windows | |
- name: Initialize jnigen | |
run: ./gradlew jnigen | |
- name: Build natives | |
run: ./gradlew jnigenBuildAllLinux jnigenBuildAllWindows jnigenBuildAllAndroid | |
- name: Pack artifacts | |
run: | | |
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" | grep "libs" > native-files-list | |
zip natives-linux -@ < native-files-list | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: natives-linux.zip | |
path: natives-linux.zip | |
build-mac: | |
runs-on: macos-14 | |
steps: | |
- name: Setup Xcode SDK | |
run: | | |
# See https://github.com/actions/virtual-environments/issues/2557 | |
sudo mv /Library/Developer/CommandLineTools/SDKs/* /tmp | |
sudo mv /Applications/Xcode.app /Applications/Xcode.app.bak | |
sudo mv /Applications/Xcode_15.4.0.app /Applications/Xcode.app | |
sudo xcode-select -switch /Applications/Xcode.app | |
/usr/bin/xcodebuild -version | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Build box2d | |
run: ./gradlew build_macos build_ios | |
- name: Initialize jnigen | |
run: ./gradlew jnigen | |
- name: Build natives | |
run: ./gradlew jnigenBuildAllIOS jnigenBuildAllMacOsX | |
- name: Pack artifacts | |
run: | | |
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" -o -name "*.xcframework" | grep "libs" > native-files-list | |
zip natives-mac -@ < native-files-list | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: natives-mac.zip | |
path: natives-mac.zip | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build-linux, build-mac] | |
env: | |
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Download Artifacts from linux | |
if: success() && needs.build-linux.result == 'success' | |
uses: actions/download-artifact@v3 | |
with: | |
name: natives-linux.zip | |
- name: Unzip artifacts | |
run: unzip -o natives-linux.zip | |
- name: Download Artifacts from mac | |
if: success() && needs.build-mac.result == 'success' | |
uses: actions/download-artifact@v3 | |
with: | |
name: natives-mac.zip | |
- name: Unzip artifacts | |
run: unzip -o natives-mac.zip | |
- name: Package All | |
run: ./gradlew jnigenPackageAll | |
- name: Snapshot build deploy | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' | |
run: | | |
./gradlew build publish -x test | |
- name: Import GPG key | |
if: github.event_name == 'release' && github.repository_owner == 'libgdx' | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@1c6a9e9d3594f2d743f1b1dd7669ab0dfdffa922 | |
with: | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Release build deploy | |
if: github.event_name == 'release' && github.repository_owner == 'libgdx' | |
run: ./gradlew build publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }} -x test | |