Modify libcpp header integration CI flow to trigger on any push. #1
This file contains hidden or 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
| name: libcpp header integration | |
| on: | |
| workflow_dispatch: | |
| push: | |
| jobs: | |
| libcpp-integration-test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| env: | |
| PROJECT_ROOT: ${{ github.workspace }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Show workspace info | |
| run: | | |
| echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" | |
| pwd | |
| ls -la | |
| test -f Makefile | |
| - name: Build sysroot | |
| working-directory: ${{ env.PROJECT_ROOT }} | |
| run: | | |
| make sysroot | |
| - name: Integrate libcpp headers and libraries into sysroot | |
| working-directory: ${{ env.PROJECT_ROOT }} | |
| run: | | |
| set -euxo pipefail | |
| mkdir -p build/sysroot/include/wasm32-wasi | |
| mkdir -p build/sysroot/lib/wasm32-wasi | |
| cp -r artifacts/include/wasm32-wasi/. build/sysroot/include/wasm32-wasi/ | |
| cp -r artifacts/lib/wasm32-wasi/. build/sysroot/lib/wasm32-wasi/ | |
| echo "Integrated include tree:" | |
| find build/sysroot/include/wasm32-wasi -maxdepth 2 | head -100 | |
| echo "Integrated lib tree:" | |
| find build/sysroot/lib/wasm32-wasi -maxdepth 2 | head -100 | |
| - name: Ensure compiler script is executable | |
| run: chmod +x scripts/lind_compile_cpp | |
| - name: Compile C++ test to wasm | |
| run: | | |
| set -euxo pipefail | |
| rm -f trial/*.wasm | |
| scripts/lind_compile_cpp trial/hello.cpp | |
| echo "Contents of trial/:" | |
| ls -la trial | |
| - name: Verify wasm output exists | |
| run: | | |
| set -euxo pipefail | |
| wasm_file="$(find trial -maxdepth 1 -type f -name '*.wasm' | head -n 1)" | |
| if [ -z "$wasm_file" ]; then | |
| echo "Expected a .wasm output in trial/, but none was found." | |
| exit 1 | |
| fi | |
| echo "Found wasm output: $wasm_file" |