diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 581da05ac8..b7c6477d16 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - type: [client] + type: [client, client-debug] fail-fast: false steps: - uses: actions/checkout@v2 @@ -52,6 +52,10 @@ jobs: if: success() && matrix.type == 'client' run: wasm/ci_configure_client.sh + - name: Configure client as webassembly + if: success() && matrix.type == 'client-debug' + run: wasm/ci_configure_client.sh debug + - name: Make if: success() run: wasm/ci_make.sh @@ -70,12 +74,19 @@ jobs: path: deploy/logs.7z - name: Prepare artifacts for deploy - if: success() && ! contains(matrix.type, 'libs') + if: success() && ! contains(matrix.type, 'libs') && ! contains(matrix.type, 'debug') env: PULL_REQUEST: ${{ github.event.number }} PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} run: python ./deploy/prepare_deployment.py wasm_${{ matrix.type }} + - name: Prepare artifacts for debug deploy + if: success() && matrix.type == 'client-debug' + env: + PULL_REQUEST: ${{ github.event.number }} + PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} + run: 7z a -t7z -mx=9 deploy/wasm_${{ matrix.type }}.7z -r0 lib/*.cpp lib/*.h client/*.cpp client/*.h client/boinc_client.html client/boinc_client.js client/boinc_client.wasm + - name: Upload artifacts uses: actions/upload-artifact@v2 if: ${{ ! contains(matrix.type, 'libs') }} diff --git a/wasm/ci_configure_client.sh b/wasm/ci_configure_client.sh index 707f653181..aac6887421 100755 --- a/wasm/ci_configure_client.sh +++ b/wasm/ci_configure_client.sh @@ -16,5 +16,13 @@ wasm/update_emsdk.sh source $EMSDK_ROOT/emsdk_env.sh wasm/update_emsdk_vcpkg.sh +debug_flags="" + +if [ "debug" == "$1" ]; then + export CPPFLAGS="-g3 -fdebug-prefix-map=$PWD=.." + debug_flags="--enable-debug" + echo -e "\e[33mDebug flags: ./configure $debug_flags, CPPFLAGS=$CPPFLAGS\e[0m" +fi + export _libcurl_pc="$VCPKG_DIR/lib/pkgconfig/libcurl.pc" -emconfigure ./configure --enable-wasm --enable-vcpkg --with-libcurl=$VCPKG_DIR --with-ssl=$VCPKG_DIR --disable-server --enable-client --disable-manager +emconfigure ./configure $debug_flags --enable-wasm --enable-vcpkg --with-libcurl=$VCPKG_DIR --with-ssl=$VCPKG_DIR --disable-server --enable-client --disable-manager