Skip to content

Commit 7c3072e

Browse files
committed
Refactor Emscripten setup in build workflow to clone and install SDK directly
1 parent 6a34515 commit 7c3072e

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/build-occt-wasm-mingw.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,23 @@ jobs:
6868
shell: pwsh
6969

7070
- name: Setup Emscripten
71-
uses: mymindstorm/setup-emsdk@v14
72-
with:
73-
version: ${{ env.EMSDK_VERSION }}
74-
actions-cache-folder: emsdk-cache
71+
run: |
72+
git clone https://github.com/emscripten-core/emsdk.git
73+
cd emsdk
74+
./emsdk install ${{ env.EMSDK_VERSION }}
75+
./emsdk activate ${{ env.EMSDK_VERSION }}
76+
echo "EMSDK=${{ github.workspace }}/emsdk" >> $GITHUB_ENV
77+
echo "${{ github.workspace }}/emsdk" >> $GITHUB_PATH
78+
echo "${{ github.workspace }}/emsdk/upstream/emscripten" >> $GITHUB_PATH
79+
shell: bash
7580

76-
- name: Configure VCPKG
81+
- name: Configure OCCT with vcpkg
7782
shell: bash
7883
run: |
84+
source ${{ github.workspace }}/emsdk/emsdk_env.sh
7985
mkdir -p build-${{ matrix.build_type }}
80-
set VCPKG_ROOT=${{ github.workspace }}/vcpkg
8186
cd build-${{ matrix.build_type }}
87+
set VCPKG_ROOT=${{ github.workspace }}/vcpkg
8288
emcmake cmake -G "Ninja" ^
8389
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ^
8490
-DVCPKG_TARGET_TRIPLET=wasm32-emscripten ^
@@ -101,8 +107,7 @@ jobs:
101107
-DUSE_OPENGL=ON ^
102108
-DINSTALL_DIR="${{ github.workspace }}/install-wasm-${{ matrix.build_type }}" ^
103109
-DCMAKE_CXX_FLAGS="-s WASM=1 -s EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] -s ALLOW_MEMORY_GROWTH=1" ^
104-
-DCMAKE_EXECUTABLE_SUFFIX=".js" ^
105-
..
110+
-DCMAKE_EXECUTABLE_SUFFIX=".js" ^ ..
106111
107112
- name: Build
108113
shell: bash

0 commit comments

Comments
 (0)