mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-05 18:25:51 +00:00
84 lines
2.7 KiB
YAML
84 lines
2.7 KiB
YAML
name: Emscripten
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
tags:
|
|
- "*"
|
|
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
name: "Libs: ${{ matrix.libs }}, FS Lib: ${{ matrix.fslib }}, SDK: ${{ matrix.emsdk-version }}, Arch: WASM, Build OS: ${{ matrix.runs-on }}"
|
|
runs-on: ${{ matrix.runs-on }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- libs: static
|
|
fslib: stl
|
|
emsdk-version: 3.1.53
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Setup emsdk
|
|
uses: mymindstorm/setup-emsdk@v14
|
|
with:
|
|
# Make sure to set a version number!
|
|
version: ${{ matrix.emsdk-version }}
|
|
# This is the name of the cache folder.
|
|
# The cache folder will be placed in the build directory,
|
|
# so make sure it doesn't conflict with anything!
|
|
actions-cache-folder: 'emsdk-cache'
|
|
|
|
- name: Verify EMSDK
|
|
run: emcc -v
|
|
|
|
- name: Install Packages
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgl1-mesa-dev mesa-common-dev libsdl2-dev libglm-dev ninja-build
|
|
|
|
- name: Build GoogleTest From Source
|
|
run: |
|
|
git clone https://github.com/projectM-visualizer/build-gtest.git ${{ github.workspace }}/build-gtest
|
|
cd ${{ github.workspace }}/build-gtest && ./setup.sh && ./build-emscripten.sh
|
|
|
|
- name: Configure Build
|
|
run: |
|
|
emcmake cmake -G "Unix Makefiles" \
|
|
-S "${{ github.workspace }}" \
|
|
-B "${{ github.workspace }}/cmake-build" \
|
|
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \
|
|
-DCMAKE_VERBOSE_MAKEFILE=YES \
|
|
-DBUILD_TESTING=YES \
|
|
-DGTest_DIR="${{ github.workspace }}/build-gtest/dist/emscripten/lib/lib/cmake/GTest"
|
|
|
|
- name: Build Debug
|
|
run: emmake cmake --build "${{ github.workspace }}/cmake-build" --parallel
|
|
|
|
# - name: Run Unit Tests
|
|
# run: ctest --test-dir "${{ github.workspace }}/cmake-build" --verbose --build-config "Debug"
|
|
|
|
# - name: Build Release
|
|
# run: emcmake cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --parallel
|
|
|
|
- name: Install
|
|
run: |
|
|
cd "${{ github.workspace }}/cmake-build" && emmake make install
|
|
|
|
# emcmake cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --target install
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: projectm-emscripten-${{ matrix.libs }}-emsdk-${{ matrix.emsdk-version }}
|
|
path: install/* |