-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
90 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ inputs: | |
description: "Specify Qt version to use" | ||
required: true | ||
qt_arch: | ||
description: "Specify Qt version to use" | ||
description: "Specify Qt arch to use" | ||
default: "gcc_64" | ||
use_qt6: | ||
description: "Specify whether we're using Qt 5 or Qt 6" | ||
|
@@ -16,6 +16,9 @@ inputs: | |
additional_cmake_args: | ||
description: "Additional args to pass to CMake" | ||
default: "" | ||
emsdk_cache_dir: | ||
description: "Where to store emsdk cache" | ||
default: "emsdk-cache" | ||
|
||
runs: | ||
using: "composite" | ||
|
@@ -45,6 +48,26 @@ runs: | |
arch: ${{ inputs.qt_arch }} | ||
install-deps: false | ||
modules: ${{ inputs.modules }} | ||
extra: --autodesktop | ||
|
||
- name: WASM-specific stuff | ||
if: inputs.qt_arch == 'wasm_singlethread' | ||
run: | | ||
echo cmake_extra_args="'-DBUILD_SHARED_LIBS=OFF' '-DQT_HOST_PATH=$(realpath ${Qt6_DIR}/../gcc_64)'" >> "$GITHUB_ENV" | ||
shell: bash | ||
|
||
- name: Setup emsdk cache | ||
id: cache-system-libraries | ||
uses: actions/cache@v2 | ||
with: | ||
key: emsdk-cache | ||
path: ${{ inputs.emsdk_cache_dir }} | ||
|
||
- uses: mymindstorm/setup-emsdk@v14 | ||
if: inputs.qt_arch == 'wasm_singlethread' | ||
with: | ||
version: 3.1.37 | ||
actions-cache-folder: ${{ inputs.emsdk_cache_dir }} | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
|
@@ -53,17 +76,18 @@ runs: | |
|
||
- name: Configure CMake | ||
run: | | ||
chmod +x "${Qt6_DIR}/bin/qt-cmake" | ||
CFLAGS="-Werror ${CFLAGS}" \ | ||
CXXFLAGS="-Werror ${CXXFLAGS}" \ | ||
cmake \ | ||
-S '${{github.workspace}}' \ | ||
-B '${{github.workspace}}/build' \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_TESTING=OFF \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-DSHVSPY_USE_QT6=${{ inputs.use_qt6 }} \ | ||
${{ env.cmake_extra_args }} \ | ||
${{ inputs.additional_cmake_args }} | ||
qt-cmake \ | ||
-S '${{github.workspace}}' \ | ||
-B '${{github.workspace}}/build' \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_TESTING=OFF \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-DSHVSPY_USE_QT6=${{ inputs.use_qt6 }} \ | ||
${{ env.cmake_extra_args }} \ | ||
${{ inputs.additional_cmake_args }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: WebAssembly | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
pages: write | ||
|
||
jobs: | ||
ubuntu-qt6-wasm: | ||
name: Qt 6.6.3 / Ubuntu 22.04 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Clone the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup CMake | ||
uses: ./.github/actions/cmake | ||
with: | ||
qt_version: 6.6.3 | ||
qt_arch: wasm_singlethread | ||
use_qt6: ON | ||
modules: qtwebsockets | ||
additional_cmake_args: -DCMAKE_INSTALL_PREFIX='${{ github.workspace }}/install-shvspy' | ||
|
||
- name: Build | ||
run: cmake --build '${{github.workspace}}/build' --parallel "$(nproc)" | ||
shell: bash | ||
|
||
- name: Consolidate WebAssembly artifacts | ||
run: | | ||
mkdir gh-sources | ||
cp '${{github.workspace}}'/build/shvspy/*.js '${{github.workspace}}'/build/shvspy/*.wasm '${{github.workspace}}'/build/shvspy/*.html gh-sources/ | ||
shell: bash | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: 'gh-sources/' | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v2 |