Skip to content

Commit

Permalink
Merge pull request #13 from Daft-Freak/patch-2
Browse files Browse the repository at this point in the history
Emscripten build
  • Loading branch information
Gadgetoid committed Feb 22, 2021
2 parents 0fd3d0a + fc2ed7b commit f2d561b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/build.yml
Expand Up @@ -7,12 +7,16 @@ name: Build

on:
push:
branches:
- '**' # only run on branches
pull_request:
release:
types: [created]

env:
BUILD_TYPE: Release
EM_VERSION: 2.0.4 # Emscripten version
EM_CACHE_FOLDER: 'emsdk-cache' # Cache for Emscripten libs

jobs:

Expand All @@ -34,6 +38,13 @@ jobs:
cmake-args: -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/32blit-sdk/32blit.toolchain
apt-packages: gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib python3-setuptools

- os: ubuntu-20.04
name: Emscripten
release-suffix: WEB
cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE/32blit-sdk
cmake-prefix: emcmake
apt-packages: python3-setuptools

- os: macos-latest
name: macOS
release-suffix: MACOS
Expand Down Expand Up @@ -85,6 +96,26 @@ jobs:
run: |
python -m pip install 32blit
# Emscripten SDK setup
- name: Setup Emscripten cache
if: matrix.name == 'Emscripten'
id: cache-system-libraries
uses: actions/cache@v2
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{runner.os}}

- name: Setup Emscripten
if: matrix.name == 'Emscripten'
uses: mymindstorm/setup-emsdk@v7
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

- name: Pre-build Emscripten ports
if: matrix.name == 'Emscripten'
run: embuilder.py build sdl2 sdl2-image-jpg sdl2-net

# Set up the cmake build environment
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/main/build
Expand All @@ -93,7 +124,7 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/main/build
run: cmake $GITHUB_WORKSPACE/main -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCPACK_PACKAGE_FILE_NAME=${{env.RELEASE_FILE}} ${{matrix.cmake-args}}
run: ${{matrix.cmake-prefix}} cmake $GITHUB_WORKSPACE/main -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCPACK_PACKAGE_FILE_NAME=${{env.RELEASE_FILE}} ${{matrix.cmake-args}}

# And then run the build itself
- name: Build
Expand Down

0 comments on commit f2d561b

Please sign in to comment.