Skip to content

Build: Wasm

Build: Wasm #20

Workflow file for this run

name: 'Build: Wasm'
on:
# pull_request: At the moment disabled for pull_request
workflow_dispatch:
inputs:
build_mode:
description: 'Build mode: devel, nightly, testing, stable'
default: 'devel'
required: true
workflow_call:
inputs:
build_mode:
description: 'Build mode: devel, nightly, testing, stable'
default: 'devel'
type: string
required: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Clone repository
uses: actions/checkout@v4
- name: Configure workflow
env:
pull_request_title: ${{ github.event.pull_request.title }}
run: |
bash ./buildscripts/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ inputs.build_mode }}
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env)
bash ./buildscripts/ci/tools/make_build_number.sh
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
ADD_INFO="_${GITHUB_REF#refs/heads/}"
if [ "${{ github.event_name }}" == "pull_request" ]; then
ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"
fi
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Wasm${ADD_INFO}")"
echo "github.repository: ${{ github.repository }}"
echo "BUILD_MODE=$BUILD_MODE" | tee -a $GITHUB_ENV
echo "BUILD_NUMBER=$BUILD_NUMBER" | tee -a $GITHUB_ENV
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" | tee -a $GITHUB_ENV
echo "CCACHE_TIMESTAMP=$(date -u +"%F-%T")" | tee -a $GITHUB_ENV
- name: Restore ccache files
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.ccache
key: wasm-ccache-${{ env.CCACHE_TIMESTAMP }}
restore-keys: wasm-ccache-
- name: Setup ccache
run: |
sudo apt-get update && sudo apt-get install -y ccache
bash ./buildscripts/ci/tools/setup_ccache_config.sh
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem_matchers/gcc.json"
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.9.1'
host: all_os
target: 'wasm'
arch: wasm_singlethread
modules: 'qt5compat qtscxml qtshadertools'
- name: Setup environment
run: |
bash ./buildscripts/ci/linux/setup.sh --arch wasm
- name: Build
env:
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}
run: |
bash ./buildscripts/ci/wasm/build.sh -n ${{ env.BUILD_NUMBER }}
echo "============== ccache ==============="
ccache -sv
- name: Package
run: |
bash ./buildscripts/ci/wasm/package.sh
- name: Upload artifacts on GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
path: ./build.artifacts/