Skip to content

Commit

Permalink
Create ci-emscripten2.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wkjarosz committed Dec 1, 2023
1 parent e21c20a commit 961312d
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci-emscripten2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Emscripten linux build

on:
push:
branches:
- "*"
pull_request:
- "*"
paths:
# This action only runs on push when C++ files are changed
- "**.cpp"
- "**.h"
- "**.cmake"
- "**Lists.txt"
- "**-emscripten2.yml"
workflow_dispatch:

env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:
name: Web app
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install cmake xorg-dev libglu1-mesa-dev zlib1g-dev libxrandr-dev ninja-build emscripten

- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

# Setup caching of build artifacts to reduce total build time (only Linux and MacOS)
- name: ccache
uses: hendrikmuhs/[email protected]

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
run: |
emcmake cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build ${{github.workspace}}/build --parallel 4

- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
${{github.workspace}}/build

0 comments on commit 961312d

Please sign in to comment.