Skip to content

Commit 94d09fd

Browse files
committed
added wasm workflow to CI
1 parent 8eec8b1 commit 94d09fd

File tree

8 files changed

+221
-6
lines changed

8 files changed

+221
-6
lines changed

.github/workflows/build_wasm.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: 'Build: Wasm'
2+
3+
on:
4+
# pull_request: At the moment disabled for pull_request
5+
workflow_dispatch:
6+
inputs:
7+
build_mode:
8+
description: 'Build mode: devel, nightly, testing, stable'
9+
default: 'devel'
10+
required: true
11+
workflow_call:
12+
inputs:
13+
build_mode:
14+
description: 'Build mode: devel, nightly, testing, stable'
15+
default: 'devel'
16+
type: string
17+
required: true
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-24.04
22+
steps:
23+
- name: Cancel Previous Runs
24+
uses: styfle/cancel-workflow-action@0.12.1
25+
with:
26+
access_token: ${{ github.token }}
27+
- name: Clone repository
28+
uses: actions/checkout@v4
29+
- name: Configure workflow
30+
env:
31+
pull_request_title: ${{ github.event.pull_request.title }}
32+
run: |
33+
bash ./buildscripts/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ inputs.build_mode }}
34+
BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env)
35+
36+
bash ./buildscripts/ci/tools/make_build_number.sh
37+
BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env)
38+
39+
ADD_INFO="_${GITHUB_REF#refs/heads/}"
40+
if [ "${{ github.event_name }}" == "pull_request" ]; then
41+
ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}"
42+
fi
43+
UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Wasm${ADD_INFO}")"
44+
45+
echo "github.repository: ${{ github.repository }}"
46+
echo "BUILD_MODE=$BUILD_MODE" | tee -a $GITHUB_ENV
47+
echo "BUILD_NUMBER=$BUILD_NUMBER" | tee -a $GITHUB_ENV
48+
echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" | tee -a $GITHUB_ENV
49+
50+
echo "CCACHE_TIMESTAMP=$(date -u +"%F-%T")" | tee -a $GITHUB_ENV
51+
52+
- name: Restore ccache files
53+
uses: actions/cache@v4
54+
with:
55+
path: ${{ github.workspace }}/.ccache
56+
key: wasm-ccache-${{ env.CCACHE_TIMESTAMP }}
57+
restore-keys: wasm-ccache-
58+
- name: Setup ccache
59+
run: |
60+
sudo apt-get update && sudo apt-get install -y ccache
61+
bash ./buildscripts/ci/tools/setup_ccache_config.sh
62+
63+
- name: Register gcc problem matcher
64+
run: echo "::add-matcher::.github/problem_matchers/gcc.json"
65+
66+
- name: Install Qt
67+
uses: jurplel/install-qt-action@v4
68+
with:
69+
version: '6.9.1'
70+
host: all_os
71+
target: 'wasm'
72+
arch: wasm_singlethread
73+
modules: 'qt5compat qtscxml qtshadertools'
74+
75+
- name: Setup environment
76+
run: |
77+
bash ./buildscripts/ci/linux/setup.sh --arch wasm
78+
- name: Build
79+
env:
80+
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}
81+
run: |
82+
bash ./buildscripts/ci/wasm/build.sh -n ${{ env.BUILD_NUMBER }}
83+
echo "============== ccache ==============="
84+
ccache -sv
85+
- name: Package
86+
run: |
87+
bash ./buildscripts/ci/wasm/package.sh
88+
- name: Upload artifacts on GitHub
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: ${{ env.UPLOAD_ARTIFACT_NAME }}
92+
path: ./build.artifacts/

.github/workflows/build_without_qt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: 'Build: Without Qt'
22

33
on:
44
pull_request:
5+
workflow_dispatch:
56

67
jobs:
78
run_tests:

buildscripts/ci/linux/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ df -h .
2828
BUILD_TOOLS=$HOME/build_tools
2929
ARTIFACTS_DIR=build.artifacts
3030
CRASH_REPORT_URL=""
31+
BUILD_NUMBER=""
3132
BUILD_MODE=""
3233
SUFFIX="" # appended to `mscore` command name to avoid conflicts (e.g. `mscoredev`)
3334

buildscripts/ci/linux/setup.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ df -h .
2626

2727
BUILD_TOOLS=$HOME/build_tools
2828
ENV_FILE=$BUILD_TOOLS/environment.sh
29-
PACKARCH="x86_64" # x86_64, armv7l, aarch64
29+
PACKARCH="x86_64" # x86_64, armv7l, aarch64, wasm
3030
COMPILER="gcc" # gcc, clang
31+
EMSDK_VERSION="3.1.70" # for Qt 6.9
3132

3233
while [[ "$#" -gt 0 ]]; do
3334
case $1 in
@@ -164,7 +165,7 @@ fi
164165
# CMAKE
165166
# Get newer CMake (only used cached version if it is the same)
166167
case "$PACKARCH" in
167-
x86_64)
168+
x86_64 | wasm)
168169
cmake_version="3.24.0"
169170
cmake_dir="$BUILD_TOOLS/cmake/${cmake_version}"
170171
if [[ ! -d "$cmake_dir" ]]; then
@@ -183,7 +184,7 @@ cmake --version
183184

184185
# Ninja
185186
case "$PACKARCH" in
186-
x86_64)
187+
x86_64 | wasm)
187188
echo "Get Ninja"
188189
ninja_dir=$BUILD_TOOLS/Ninja
189190
if [[ ! -d "$ninja_dir" ]]; then
@@ -201,6 +202,17 @@ esac
201202
echo "ninja version"
202203
ninja --version
203204

205+
if [[ "$PACKARCH" == "wasm" ]]; then
206+
git clone https://github.com/emscripten-core/emsdk.git $BUILD_TOOLS/emsdk
207+
origin_dir=$(pwd)
208+
cd $BUILD_TOOLS/emsdk
209+
git pull
210+
./emsdk install $EMSDK_VERSION
211+
./emsdk activate $EMSDK_VERSION
212+
echo "source $BUILD_TOOLS/emsdk/emsdk_env.sh" >> ${ENV_FILE}
213+
cd $origin_dir
214+
fi
215+
204216
##########################################################################
205217
# POST INSTALL
206218
##########################################################################

buildscripts/ci/wasm/build.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: GPL-3.0-only
3+
# MuseScore-Studio-CLA-applies
4+
#
5+
# MuseScore Studio
6+
# Music Composition & Notation
7+
#
8+
# Copyright (C) 2025 MuseScore Limited
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License version 3 as
12+
# published by the Free Software Foundation.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
22+
trap 'echo Build failed; exit 1' ERR
23+
24+
BUILD_TOOLS=$HOME/build_tools
25+
ARTIFACTS_DIR=build.artifacts
26+
BUILD_DIR=build.release
27+
BUILD_NUMBER=""
28+
BUILD_MODE=""
29+
30+
while [[ "$#" -gt 0 ]]; do
31+
case $1 in
32+
-n|--number) BUILD_NUMBER="$2"; shift ;;
33+
--build_mode) BUILD_MODE="$2"; shift ;;
34+
*) echo "Unknown parameter passed: $1"; exit 1 ;;
35+
esac
36+
shift
37+
done
38+
39+
if [ -z "$BUILD_NUMBER" ]; then echo "error: not set BUILD_NUMBER"; exit 1; fi
40+
if [ -z "$BUILD_MODE" ]; then BUILD_MODE=$(cat $ARTIFACTS_DIR/env/build_mode.env); fi
41+
42+
MUSE_APP_BUILD_MODE=dev
43+
44+
case "${BUILD_MODE}" in
45+
"devel") MUSE_APP_BUILD_MODE=dev; SUFFIX=dev;;
46+
"nightly") MUSE_APP_BUILD_MODE=dev; SUFFIX=nightly;;
47+
"testing") MUSE_APP_BUILD_MODE=testing; SUFFIX=testing;;
48+
"stable") MUSE_APP_BUILD_MODE=release; SUFFIX="";;
49+
esac
50+
51+
echo "MUSE_APP_BUILD_MODE: $MUSE_APP_BUILD_MODE"
52+
echo "BUILD_MODE: $BUILD_MODE"
53+
echo "BUILD_NUMBER: $BUILD_NUMBER"
54+
55+
echo "=== ENVIRONMENT === "
56+
57+
cat $BUILD_TOOLS/environment.sh
58+
source $BUILD_TOOLS/environment.sh
59+
60+
export CMAKE_TOOLCHAIN_FILE=${QT_ROOT_DIR}/lib/cmake/Qt6/qt.toolchain.cmake
61+
62+
# =========== Build =======================
63+
echo "=== BUILD ==="
64+
65+
MUSESCORE_REVISION=$(git rev-parse --short=7 HEAD)
66+
67+
# Build portable AppImage
68+
MUSE_APP_BUILD_MODE=$MUSE_APP_BUILD_MODE \
69+
MUSESCORE_BUILD_CONFIGURATION="app-web" \
70+
MUSESCORE_BUILD_NUMBER=$BUILD_NUMBER \
71+
MUSESCORE_REVISION=$MUSESCORE_REVISION \
72+
bash ./ninja_build.sh -t release
73+
74+
bash ./buildscripts/ci/tools/make_release_channel_env.sh -c $MUSE_APP_BUILD_MODE
75+
bash ./buildscripts/ci/tools/make_version_env.sh $BUILD_NUMBER
76+
bash ./buildscripts/ci/tools/make_revision_env.sh $MUSESCORE_REVISION
77+
bash ./buildscripts/ci/tools/make_branch_env.sh
78+

buildscripts/ci/wasm/package.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: GPL-3.0-only
3+
# MuseScore-Studio-CLA-applies
4+
#
5+
# MuseScore Studio
6+
# Music Composition & Notation
7+
#
8+
# Copyright (C) 2025 MuseScore Limited
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License version 3 as
12+
# published by the Free Software Foundation.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
echo "Package MuseScore Wasm"
22+
trap 'echo Package failed; exit 1' ERR
23+
24+
BUILD_TOOLS=$HOME/build_tools
25+
ARTIFACTS_DIR=build.artifacts
26+
BUILD_DIR=build.release
27+
28+
cp -r $BUILD_DIR/public_html $ARTIFACTS_DIR/public_html

src/appshell_web/internal/applicationuiactions.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@
2323
#define MU_APPSHELL_APPLICATIONUIACTIONS_H
2424

2525
#include "ui/iuiactionsmodule.h"
26-
#include "applicationactioncontroller.h"
26+
27+
#include "global/async/asyncable.h"
28+
2729
#include "modularity/ioc.h"
28-
#include "async/asyncable.h"
2930
#include "ui/imainwindow.h"
3031
#include "braille/ibrailleconfiguration.h"
3132
#include "notation/inotationconfiguration.h"
3233
#include "dockwindow/idockwindowprovider.h"
34+
#include "../iappshellconfiguration.h"
3335

3436
#include "../appshelltypes.h"
37+
#include "applicationactioncontroller.h"
3538

3639
namespace mu::appshell {
3740
class ApplicationUiActions : public muse::ui::IUiActionsModule, public muse::Injectable, public muse::async::Asyncable

src/framework/diagnostics/view/diagnosticaccessiblemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ void DiagnosticAccessibleModel::init()
5858
#endif
5959
}
6060

61+
#ifdef MUSE_MODULE_ACCESSIBILITY
6162
static void debug_dumpItem(QAccessibleInterface* item, QTextStream& stream, QString& level)
6263
{
6364
QAccessibleInterface* prn = item->parent();
@@ -87,7 +88,6 @@ static void debug_dumpItem(QAccessibleInterface* item, QTextStream& stream, QStr
8788
level.chop(2);
8889
}
8990

90-
#ifdef MUSE_MODULE_ACCESSIBILITY
9191
static void debug_dumpTree(QAccessibleInterface* item)
9292
{
9393
QString str;

0 commit comments

Comments
 (0)