From 961312d952c758976e8d18f0a6bcd693106d7da1 Mon Sep 17 00:00:00 2001 From: Wojciech Jarosz Date: Fri, 1 Dec 2023 23:16:44 +0100 Subject: [PATCH] Create ci-emscripten2.yml --- .github/workflows/ci-emscripten2.yml | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ci-emscripten2.yml diff --git a/.github/workflows/ci-emscripten2.yml b/.github/workflows/ci-emscripten2.yml new file mode 100644 index 0000000..e1b35d7 --- /dev/null +++ b/.github/workflows/ci-emscripten2.yml @@ -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/ccache-action@v1.2 + + - 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