Skip to content

Android: minimal changes to Java to make it work #1099

Android: minimal changes to Java to make it work

Android: minimal changes to Java to make it work #1099

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
strategy:
matrix:
cxx: [g++-12, clang++-14]
include:
- cxx: g++-12
cc: gcc-12
- cxx: clang++-14
cc: clang-14
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v4
with:
node-version: 18
- name: apt update
run: sudo apt-get -o Acquire::Retries=3 update
- name: install opengl
run: sudo apt-get -o Acquire::Retries=3 install mesa-common-dev libgl1-mesa-dev libgl1-mesa-glx
- name: cmake
working-directory: dev
run: CXX=${{ matrix.cxx }} CC=${{ matrix.cc }} cmake -DCMAKE_BUILD_TYPE=Release -DLOBSTER_WERROR=ON .
- name: build
working-directory: dev
run: make -j4
- name: test
run: bin/lobster tests/unittest.lobster
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Linux Lobster binary ${{ matrix.cxx }}
path: bin/lobster
- name: test cpp generation
run: bin/lobster --cpp tests/unittest.lobster
- name: cmake cpp output
working-directory: dev
# In addition to C++ out, build this one in Debug and without the engine for extra coverage.
# Removed -DLOBSTER_ENGINE=OFF for now as it interferes with builtin function checksumming.
run: CXX=${{ matrix.cxx }} CC=${{ matrix.cc }} cmake -DCMAKE_BUILD_TYPE=Debug -DLOBSTER_WERROR=ON -DLOBSTER_TOCPP=ON .
- name: build cpp output
working-directory: dev
run: make -j4
- name: test cpp output
run: bin/compiled_lobster
- name: test lsp
run: cd dev/lsp && npm install && npm run test
build-windows:
name: Build Windows
runs-on: windows-2022
steps:
- uses: actions/checkout@v1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: build
working-directory: dev/lobster
run: msbuild.exe lobster.sln /p:Configuration=Release /p:Platform=x64
- name: test
run: bin/lobster.exe tests/unittest.lobster
- name: test lsp
run: cd dev/lsp && npm install && npm test
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Windows Lobster binary
path: bin/lobster.exe
build-mac:
name: Build Mac
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-12
artifact_name: Mac (Apple x64 Intel) Lobster binary
- os: macos-14
artifact_name: Mac (Apple ARM Silicon) Lobster binary
steps:
- uses: actions/checkout@v1
- name: cmake
working-directory: dev
run: sh build_osx.sh
- name: build
working-directory: dev/xcode-cmake
run: xcodebuild -toolchain clang -configuration Release -target lobster
- name: test
run: bin/lobster tests/unittest.lobster
- name: test lsp
run: |
cd dev/lsp
npm install
npm test
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: bin/lobster
build-android:
name: Build Android (on Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'zulu'
# Now we're first going to build the native Linux exe, so we can generate C++ code.
# Without engine should speed this up.
- name: cmake
working-directory: dev
run: CXX=clang++-14 CC=clang-14 cmake -DCMAKE_BUILD_TYPE=Release -DLOBSTER_WERROR=ON -DLOBSTER_ENGINE=OFF .
- name: build
working-directory: dev
run: make -j4
# Generate C++ code.
- name: test cpp generation
run: bin/lobster --cpp tests/unittest.lobster
- name: build android
working-directory: dev/android-project
run: bash ./gradlew buildDebug
build-emscripten:
name: Build Wasm (on Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/checkout@v1
- name: apt update
run: sudo apt-get -o Acquire::Retries=3 update
- name: install ninja
run: sudo apt-get -o Acquire::Retries=3 install ninja-build
- name: emsdk install
run: |
mkdir $HOME/emsdk
git clone --depth 1 https://github.com/emscripten-core/emsdk.git $HOME/emsdk
$HOME/emsdk/emsdk update-tags
$HOME/emsdk/emsdk install latest
$HOME/emsdk/emsdk activate latest
echo "$HOME/emsdk" >> $GITHUB_PATH
# Now we're first going to build the native Linux exe, so we can generate C++ code.
# Without engine should speed this up.
- name: cmake
working-directory: dev
run: CXX=clang++-14 CC=clang-14 cmake -DCMAKE_BUILD_TYPE=Release -DLOBSTER_WERROR=ON -DLOBSTER_ENGINE=OFF .
- name: build
working-directory: dev
run: make -j4
# Generate C++
- name: test cpp generation
run: bin/lobster --cpp tests/unittest.lobster
# Build.
- name: emcc-build cpp
run: |
source $HOME/emsdk/emsdk_env.sh
cd dev/emscripten && make -j4