Updating PRIME with hierarchical testing #202
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: WebAssembly Build | |
| on: | |
| push: | |
| branches: [ master, develop ] | |
| pull_request: | |
| branches: [ master, develop ] | |
| # Allows running this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-wasm: | |
| name: Build WebAssembly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Emscripten | |
| uses: mymindstorm/setup-emsdk@v12 | |
| with: | |
| version: 'latest' | |
| - name: Verify Emscripten installation | |
| run: | | |
| emcc --version | |
| - name: Configure and build with Emscripten | |
| run: | | |
| mkdir -p build | |
| cd build | |
| # Configure with preload files to generate hyphy.data | |
| # Map local ../res to /res in the virtual filesystem | |
| emcmake cmake .. -DCMAKE_EXE_LINKER_FLAGS="-sTOTAL_STACK=2097152 -O2 -sASSERTIONS=1 -sMODULARIZE=1 -sALLOW_MEMORY_GROWTH -sFORCE_FILESYSTEM=1 -sEXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=[\"callMain\",\"FS\",\"PROXYFS\",\"WORKERFS\",\"UTF8ToString\",\"getValue\",\"AsciiToString\"] -lworkerfs.js -lproxyfs.js -s INVOKE_RUN=0 -s ENVIRONMENT=\"web,worker\" -fwasm-exceptions --preload-file ../res@/res" | |
| emmake make -j hyphy | |
| - name: Display build artifacts | |
| run: | | |
| cd build | |
| ls -la | |
| - name: Upload WASM artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hyphy-wasm | |
| path: | | |
| build/hyphy.js | |
| build/hyphy.wasm | |
| build/hyphy.data | |
| retention-days: 30 | |
| - name: Prepare for deployment | |
| run: | | |
| mkdir -p public | |
| cp build/hyphy.js public/ | |
| cp build/hyphy.wasm public/ | |
| cp build/hyphy.data public/ | |
| echo "<html><body><h1>HyPhy WASM Build</h1><ul><li><a href='hyphy.wasm'>hyphy.wasm</a></li><li><a href='hyphy.js'>hyphy.js</a></li><li><a href='hyphy.data'>hyphy.data</a></li></ul></body></html>" > public/index.html | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./public | |
| publish_branch: gh-pages |