Skip to content

Add build wasm step #16

Add build wasm step

Add build wasm step #16

Workflow file for this run

name: wasm
on:
push:
#schedule:
# - cron: '*/120 8-18 * * *' # every 2 hours from 8:00 to 18:00 every day
jobs:
build: # the first job
# current job matrix. if modified, remember to UPDATE the strategy in the next job
strategy:
fail-fast: false
matrix:
os: [macos-14]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps: # job steps
- name: Check-out repository
uses: actions/checkout@v4
- name: Cache emsdk
id: cache-emsdk
uses: actions/cache@v4
with:
path: ~/emsdk
key: ${{ runner.os }}-emsdk
- name: Install emsdk
if: steps.cache-emsdk.outputs.cache-hit != 'true'
shell: bash
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
./emsdk install 3.1.50 # this version is needed for Qt 6.7
./emsdk activate 3.1.50
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ~/Qt
key: ${{ runner.os }}-qt
- name: Install Qt for WebAssembly
if: steps.cache-qt.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L -O https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg
chmod u+x qt-unified-mac-x64-online.dmg
hdiutil attach qt-unified-mac-x64-online.dmg
/Volumes/qt-online-installer-macOS-x64-4.8.0/qt-online-installer-macOS-x64-4.8.0.app/Contents/MacOS/qt-online-installer-macOS-x64-4.8.0 \
--email ${{ secrets.QT_ACCOUNT_EMAIL }} \
--pw ${{ secrets.QT_ACCOUNT_PASSWORD }} \
--root ~/Qt \
--accept-licenses \
--accept-obligations \
--default-answer \
--confirm-command \
install qt.qt6.672.wasm_singlethread qt.qt6.672.qt5compat
hdiutil detach /Volumes/qt-online-installer-macOS-x64-4.8.0
- name: Print some debug info
shell: bash
run: |
source ~/emsdk/emsdk_env.sh
em++ --version
~/Qt/6.7.2/wasm_singlethread/bin/qmake -v
- name: Build WASM from BasicMinimalC++
shell: bash
run: |
cd examples/BasicMinimalC++/src
source ~/emsdk/emsdk_env.sh
~/Qt/6.7.2/wasm_singlethread/bin/qmake BasicMinimalC++.pro -spec wasm-emscripten
make -j