Skip to content
Snippets Groups Projects
Unverified Commit 94a6b023 authored by Mateusz Tyszczak's avatar Mateusz Tyszczak :scroll:
Browse files

Add TARGET_ENVIRONMENT and WASM_USE_FS options to wasm_build job template

parent 40451cfb
No related branches found
No related tags found
1 merge request!70Add options to wasm build
Pipeline #115519 passed
include:
- local: templates/npm_projects.gitlab-ci.yml
.wasm_compare_job_template:
extends: .npm_based_job_base
variables:
# The directory containing sources to be built - it should be overrided by derived job
SOURCE_DIR: ""
# Output directory where should be stored binaries - it should be overrided by derived job
BINARIES_DIR: ""
script:
- |
first_checksum=""
find "${BINARIES_DIR}" -type f -name '*.wasm' | while read -r wasm_file; do
checksum=$(sha256sum "$wasm_file" | awk '{ print $1 }')
echo "Checksum for file $wasm_file: $checksum"
if [[ -z "$first_checksum" ]]; then
first_checksum="$checksum"
fi
if [[ "$checksum" != "$first_checksum" ]]; then
echo "Error: Checksum mismatch found for file $wasm_file"
exit 1
fi
done
echo "All .wasm files have the same SHA-256 checksum: $first_checksum"
.wasm_build_job_template:
extends: .npm_based_job_base
variables:
......@@ -8,17 +35,26 @@ include:
SOURCE_DIR: ""
# Output directory where should be stored binaries - it should be overrided by derived job
BINARIES_DIR: ""
# Target component name from client cmake to be installed in the BINARIES_DIR
COMPONENT_INSTALL_NAME: ""
# Target environment for WASM to build - shouble be either web or node
TARGET_ENVIRONMENT: "web"
# Should include filesystem support based on the target environment (idbfs or node fs) - set to either 1 (enabled) or 0 (disabled)
WASM_USE_FS: "0"
script:
- mkdir -vp "${BINARIES_DIR}"
- cd "${BINARIES_DIR}"
- cmake -DBoost_NO_WARN_NEW_VERSIONS=1 -DBoost_USE_STATIC_RUNTIME=ON -DCMAKE_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -S "${SOURCE_DIR}" -B "${BINARIES_DIR}"
- mkdir -vp "${BINARIES_DIR}/${TARGET_ENVIRONMENT}"
- cd "${BINARIES_DIR}/${TARGET_ENVIRONMENT}"
- cmake -DBoost_NO_WARN_NEW_VERSIONS=1 -DBoost_USE_STATIC_RUNTIME=ON -DCMAKE_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DWASM_USE_FS="${WASM_USE_FS}" -DTARGET_ENVIRONMENT="${TARGET_ENVIRONMENT}" -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -S "${SOURCE_DIR}" -B "${BINARIES_DIR}/${TARGET_ENVIRONMENT}"
- make -j 8
- cmake --install "${BINARIES_DIR}/${TARGET_ENVIRONMENT}" --component "${COMPONENT_INSTALL_NAME}.common_runtime" --prefix "${BINARIES_DIR}"
artifacts:
paths:
- "${BINARIES_DIR}/${TARGET_ENVIRONMENT}/*.d.ts"
- "${BINARIES_DIR}/${TARGET_ENVIRONMENT}/*.js"
- "${BINARIES_DIR}/${TARGET_ENVIRONMENT}/*.wasm"
- "${BINARIES_DIR}/*.d.ts"
- "${BINARIES_DIR}/*.mjs"
- "${BINARIES_DIR}/*.js"
- "${BINARIES_DIR}/*.wasm"
when: always
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment