fix: correct FTBFS for Android #56
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: "Build & Test" | |
on: [push, pull_request] | |
jobs: | |
macOS: | |
runs-on: macos-latest | |
timeout-minutes: 30 | |
env: | |
MACOSX_DEPLOYMENT_TARGET: "10.9" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download LuaJIT | |
uses: actions/checkout@v4 | |
with: | |
repository: LuaJIT/LuaJIT | |
ref: v2.1 | |
path: LuaJIT | |
- name: Compile universal LuaJIT | |
working-directory: ./LuaJIT | |
run: | | |
TARGET_FLAGS="-arch x86_64" make | |
cp ./src/libluajit.so ./src/libluajit_x64.dylib | |
cp ./src/luajit ./src/luajit_x64 | |
make clean | |
TARGET_FLAGS="-arch arm64" make | |
cp ./src/libluajit.so ./src/libluajit_arm.dylib | |
cp ./src/luajit ./src/luajit_arm | |
lipo -create -output ./src/libluajit.dylib ./src/libluajit_x64.dylib ./src/libluajit_arm.dylib | |
lipo -create -output ./src/luajit ./src/luajit_x64 ./src/luajit_arm | |
- name: Configure | |
run: cmake -Bbuild -S. -G Xcode -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DLUA_INCLUDE_DIR=$PWD/LuaJIT/src -DLUA_LIBRARIES=$PWD/LuaJIT/src/lua | |
- name: Build | |
working-directory: build | |
run: xcodebuild -configuration Release -scheme https -destination generic/platform=macOS | |
- name: Test | |
working-directory: ./build/src/Release | |
run: ../../../LuaJIT/src/luajit -l "https" ../../../example/test.lua | |
- name: Artifact | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: https-macos.zip | |
path: build/src/**/https.so | |
Linux: | |
name: ${{ matrix.mode.name }} | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
mode: | |
- name: Linux cURL | |
curl: 1 | |
openssl: 0 | |
artifact: 0 | |
- name: Linux OpenSSL | |
curl: 0 | |
openssl: 1 | |
artifact: 0 | |
- name: Linux cURL & OpenSSL | |
curl: 1 | |
openssl: 1 | |
artifact: 1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update APT Repository | |
run: sudo apt-get update | |
- name: Install Dependencies | |
run: sudo apt-get install -y lua5.1 luajit liblua5.1-0-dev libcurl4-openssl-dev g++ libssl-dev | |
- name: Configure | |
run: cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Release -DUSE_CURL_BACKEND=${{ matrix.mode.curl }} -DUSE_OPENSSL_BACKEND=${{ matrix.mode.openssl }} | |
- name: Build | |
run: cmake --build build --config Release --target install -j$(nproc) | |
- name: Test (Lua) | |
if: matrix.mode.artifact == 0 | |
working-directory: ./install | |
run: lua -l "https" ../example/test.lua | |
- name: Test (LuaJIT) | |
if: matrix.mode.artifact == 0 | |
working-directory: ./install | |
run: luajit -l "https" ../example/test.lua | |
- name: Artifact | |
if: matrix.mode.artifact == 1 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: https-ubuntu.zip | |
path: install/https.so | |
Windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
arch: | |
- Win32 | |
- x64 | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download LuaJIT | |
uses: actions/checkout@v4 | |
with: | |
repository: LuaJIT/LuaJIT | |
ref: v2.1 | |
path: LuaJIT | |
- name: Configure MSVC Developer Command Prompt | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Compile LuaJIT | |
working-directory: ./LuaJIT/src | |
run: msvcbuild.bat amalg | |
- name: Configure | |
run: cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=%CD%\install -A ${{ matrix.arch }} -DLUA_INCLUDE_DIR=%CD%\LuaJIT\src -DLUA_LIBRARIES=%CD%\LuaJIT\src\lua51.lib | |
- name: Build | |
run: cmake --build build --config Release --target install | |
- name: Test | |
working-directory: ./install | |
run: ..\LuaJIT\src\luajit ..\example\test.lua | |
- name: Artifact | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: https-windows-${{ matrix.arch }}.zip | |
path: install/https.dll | |
Android: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout love-android | |
uses: actions/checkout@v4 | |
with: | |
repository: love2d/love-android | |
ref: 11.5a | |
submodules: recursive | |
path: ./tools/love-android | |
- name: Checkout lua-https | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
path: ./tools/love-android/love/src/jni/lua-modules/lua-https | |
- name: Get Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
cache: gradle | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Android SDK | |
uses: android-actions/[email protected] | |
with: | |
cmdline-tools-version: 11076708 | |
packages: >- | |
tools | |
platform-tools | |
platforms;android-34 | |
build-tools;33.0.1 | |
ndk;25.2.9519653 | |
log-accepted-android-sdk-licenses: false | |
- name: Build Android release .apk | |
run: | | |
pushd ./tools/love-android | |
./gradlew assembleEmbedNoRecordRelease | |
popd | |
# Extract the https.so files with preserved directory structure | |
for ARCH in arm64-v8a armeabi-v7a; do | |
mkdir -p "./tools/https/lib/$ARCH" | |
unzip -j ./tools/love-android/app/build/outputs/apk/embedNoRecord/release/app-embed-noRecord-release-unsigned.apk "lib/$ARCH/https.so" -d "./tools/https/lib/$ARCH/" | |
ls -la "./tools/https/lib/$ARCH/" | |
done | |
- name: Artifact arm64-v8a | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: https-android-arm64-v8a.zip | |
path: ./tools/https/lib/arm64-v8a/https.so | |
- name: Artifact armeabi-v7a | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: https-android-armeabi-v7a.zip | |
path: ./tools/https/lib/armeabi-v7a/https.so |