forked from wheremyfoodat/Panda3DS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
304f2c9
commit 597b016
Showing
1 changed file
with
24 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,37 +17,26 @@ jobs: | |
|
||
steps: | ||
- name: Set BUILD_TYPE variable | ||
run: echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV | ||
run: | | ||
echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV | ||
git diff --exit-code --quiet -- '*.cpp' '*.h' '*.hpp' || echo "CODE_CHANGED=true" >> $GITHUB_ENV | ||
git diff --exit-code --quiet -- submodule || echo "CODE_CHANGED=true" >> $GITHUB_ENV | ||
- uses: actions/checkout@v4 | ||
- name: Fetch submodules | ||
run: git submodule update --init --recursive | ||
|
||
- name: Check if code has changed | ||
id: code_changed | ||
run: | | ||
# Check for changes in .cpp, .h, .hpp files or submodules | ||
git diff --exit-code --quiet -- '*.cpp' '*.h' '*.hpp' || echo "Code changed" >> $GITHUB_ENV | ||
git diff --exit-code --quiet -- submodule || echo "Submodules changed" >> $GITHUB_ENV | ||
- name: Set up gradle caches | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
~/src/pandroid/app/src/main/jniLibs/x86_64/libAlber.so | ||
key: ${{ runner.os }}-pandroid-x86_64-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-pandroid-x86_64- | ||
- name: Cache libAlber.so (x86_64) | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./src/pandroid/app/src/main/jniLibs/x86_64/libAlber.so | ||
key: ${{ runner.os }}-pandroid-x86_64-libAlber-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-pandroid-x86_64-libAlber- | ||
- name: Setup Vulkan SDK | ||
uses: humbletim/[email protected] | ||
with: | ||
|
@@ -62,25 +51,29 @@ jobs: | |
java-version: '17' | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DENABLE_VULKAN=0 -DENABLE_USER_BUILD=ON | ||
run: | | ||
if [[ "${{ env.CODE_CHANGED }}" != "true" ]] || [ ! -f "./src/pandroid/app/src/main/jniLibs/x86_64/libAlber.so" ]; then | ||
echo "Code changed, rebuilding from scratch..." | ||
cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DENABLE_VULKAN=0 -DENABLE_USER_BUILD=ON | ||
fi | ||
- name: Build | ||
run: | | ||
# Apply patch for GLES compatibility | ||
git apply ./.github/gles.patch | ||
# Skip using the cache if code has changed | ||
if [[ "${{ env.CODE_CHANGED }}" == "true" ]]; then | ||
echo "Code changed, rebuilding from scratch..." | ||
if [[ "${{ env.CODE_CHANGED }}" == "true" ]] || [ -f "./src/pandroid/app/src/main/jniLibs/x86_64/libAlber.so" ]; then | ||
rm -f ./src/pandroid/app/src/main/jniLibs/x86_64/libAlber.so | ||
fi | ||
# Build the project with CMake | ||
cmake --build ${{github.workspace}}/build --config ${{ env.BUILD_TYPE }} | ||
if [[ "${{ env.CODE_CHANGED }}" != "true" ]] || [ ! -f "./src/pandroid/app/src/main/jniLibs/x86_64/libAlber.so" ]; then | ||
# Apply patch for GLES compatibility | ||
git apply ./.github/gles.patch | ||
# Build the project with CMake | ||
cmake --build ${{github.workspace}}/build --config ${{ env.BUILD_TYPE }} | ||
# Strip the generated library and move it to the appropriate location | ||
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded ./build/libAlber.so | ||
mv ./build/libAlber.so ./src/pandroid/app/src/main/jniLibs/x86_64/ | ||
# Strip the generated library and move it to the appropriate location | ||
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded ./build/libAlber.so | ||
mv ./build/libAlber.so ./src/pandroid/app/src/main/jniLibs/x86_64/ | ||
fi | ||
# Build the Android app with Gradle | ||
cd src/pandroid | ||
|
@@ -106,8 +99,8 @@ jobs: | |
- name: Set BUILD_TYPE variable | ||
run: | | ||
echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV | ||
git diff --exit-code --quiet -- '*.cpp' '*.h' '*.hpp' || echo "Code changed" >> $GITHUB_ENV | ||
git diff --exit-code --quiet -- submodule || echo "Submodules changed" >> $GITHUB_ENV | ||
git diff --exit-code --quiet -- '*.cpp' '*.h' '*.hpp' || echo "CODE_CHANGED=true" >> $GITHUB_ENV | ||
git diff --exit-code --quiet -- submodule || echo "CODE_CHANGED=true" >> $GITHUB_ENV | ||
- uses: actions/checkout@v4 | ||
- name: Fetch submodules | ||
|
@@ -140,7 +133,7 @@ jobs: | |
|
||
- name: Configure CMake | ||
run: | | ||
if [[ "${{ env.CODE_CHANGED }}" != "true" ]]; then | ||
if [[ "${{ env.CODE_CHANGED }}" != "true" ]] || [ ! -f "./src/pandroid/app/src/main/jniLibs/arm64-v8a/libAlber.so" ]; then | ||
echo "Code changed, rebuilding from scratch..." | ||
cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DENABLE_VULKAN=0 -DENABLE_USER_BUILD=ON -DCMAKE_CXX_FLAGS="-march=armv8-a+crypto" | ||
fi | ||
|
@@ -152,7 +145,7 @@ jobs: | |
rm -f ./src/pandroid/app/src/main/jniLibs/arm64-v8a/libAlber.so | ||
fi | ||
if [[ "${{ env.CODE_CHANGED }}" != "true" ]]; then | ||
if [[ "${{ env.CODE_CHANGED }}" != "true" ]] || [ ! -f "./src/pandroid/app/src/main/jniLibs/arm64-v8a/libAlber.so" ]; then | ||
# Apply patch for GLES compatibility | ||
git apply ./.github/gles.patch | ||
|