Add support for encoded local pids in external terms #1473
Workflow file for this run
This file contains 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
# | |
# Copyright 2023 Paul Guyot <[email protected]> | |
# | |
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
# | |
name: Wasm Build | |
on: | |
push: | |
paths: | |
- '.github/workflows/wasm-build.yaml' | |
- 'CMakeLists.txt' | |
- 'libs/**' | |
- 'src/platforms/emscripten/**' | |
- 'src/libAtomVM/**' | |
pull_request: | |
paths: | |
- '.github/workflows/wasm-build.yaml' | |
- 'CMakeLists.txt' | |
- 'libs/**' | |
- 'src/platforms/emscripten/**' | |
- 'src/libAtomVM/**' | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
compile_tests: | |
runs-on: ubuntu-24.04 | |
container: erlang:27 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install required packages | |
run: apt update && apt install -y gperf zlib1g-dev cmake ninja-build | |
- name: Compile AtomVM and test modules | |
run: | | |
set -e | |
mkdir build | |
cd build | |
cmake .. -G Ninja -DAVM_WARNINGS_ARE_ERRORS=ON | |
# test_eavmlib does not work with wasm due to http + ssl test | |
ninja AtomVM atomvmlib test_etest test_alisp hello_world run_script call_cast html5_events wasm_webserver | |
- name: Upload AtomVM and test modules | |
uses: actions/upload-artifact@v4 | |
with: | |
name: atomvm-and-test-modules | |
path: | | |
build/**/*.avm | |
build/**/*.beam | |
build/src/AtomVM | |
retention-days: 1 | |
- name: Compile emscripten test modules | |
run: | | |
set -e | |
cd src/platforms/emscripten | |
mkdir -p build/tests/src/ | |
cd build/tests/src | |
cmake ../../../tests/src -G Ninja | |
ninja emscripten_erlang_test_modules | |
- name: Upload emscripten test modules | |
uses: actions/upload-artifact@v4 | |
with: | |
name: emscripten-test-modules | |
path: | | |
src/platforms/emscripten/build/**/*.beam | |
retention-days: 1 | |
wasm_build_and_test_node: | |
needs: compile_tests | |
runs-on: ubuntu-latest | |
container: emscripten/emsdk | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: "Install deps" | |
run: sudo apt update -y && sudo apt install -y cmake gperf | |
- name: Build | |
shell: bash | |
working-directory: ./src/platforms/emscripten/ | |
run: | | |
set -euo pipefail | |
mkdir build | |
cd build | |
emcmake cmake .. | |
emmake make -j | |
- name: Download AtomVM and test modules | |
uses: actions/download-artifact@v4 | |
with: | |
name: atomvm-and-test-modules | |
path: build | |
- name: Test | |
shell: bash | |
working-directory: ./src/platforms/emscripten/build | |
run: | | |
set -euxo pipefail | |
# Test compressed beams | |
node src/AtomVM.js ../../../../build/examples/erlang/hello_world.beam ../../../../build/libs/eavmlib/src/eavmlib.avm | |
# Run tests that pass | |
node src/AtomVM.js ../../../../build/tests/libs/alisp/test_alisp.avm | |
# test_eavmlib does not work with wasm due to http + ssl test | |
# node src/AtomVM.js ../../../../build/tests/libs/eavmlib/test_eavmlib.avm | |
node src/AtomVM.js ../../../../build/tests/libs/etest/test_etest.avm | |
- name: "Rename and write sha256sum (node)" | |
if: startsWith(github.ref, 'refs/tags/') | |
shell: bash | |
working-directory: src/platforms/emscripten/build/src | |
run: | | |
ATOMVM_JS=AtomVM-node-${{ github.ref_name }}.js | |
mv AtomVM.js "${ATOMVM_JS}" | |
sha256sum "${ATOMVM_JS}" > "${ATOMVM_JS}.sha256" | |
ATOMVM_WORKER_JS=AtomVM.worker-node-${{ github.ref_name }}.js | |
mv AtomVM.worker.js "${ATOMVM_WORKER_JS}" | |
sha256sum "${ATOMVM_WORKER_JS}" > "${ATOMVM_WORKER_JS}.sha256" | |
ATOMVM_WASM=AtomVM-node-${{ github.ref_name }}.wasm | |
mv AtomVM.wasm "${ATOMVM_WASM}" | |
sha256sum "${ATOMVM_WASM}" > "${ATOMVM_WASM}.sha256" | |
- name: "Release (node)" | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
fail_on_unmatched_files: true | |
files: | | |
src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.js | |
src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.js.sha256 | |
src/platforms/emscripten/build/src/AtomVM.worker-node-${{ github.ref_name }}.js | |
src/platforms/emscripten/build/src/AtomVM.worker-node-${{ github.ref_name }}.js.sha256 | |
src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.wasm | |
src/platforms/emscripten/build/src/AtomVM-node-${{ github.ref_name }}.wasm.sha256 | |
wasm_build_web: | |
runs-on: ubuntu-latest | |
container: emscripten/emsdk | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: "Install deps" | |
run: sudo apt update -y && sudo apt install -y cmake gperf | |
- name: Build wasm build for web | |
shell: bash | |
working-directory: ./src/platforms/emscripten/ | |
run: | | |
set -euo pipefail | |
mkdir build | |
cd build | |
emcmake cmake .. -DAVM_EMSCRIPTEN_ENV=web | |
emmake make -j | |
- name: Upload wasm build for web | |
uses: actions/upload-artifact@v4 | |
with: | |
name: atomvm-js-web | |
path: | | |
src/platforms/emscripten/build/**/*.wasm | |
src/platforms/emscripten/build/**/*.js | |
retention-days: 1 | |
wasm_test_web: | |
needs: [compile_tests, wasm_build_web] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Download AtomVM and test modules | |
uses: actions/download-artifact@v4 | |
with: | |
name: atomvm-and-test-modules | |
path: build | |
- name: Download wasm build for web | |
uses: actions/download-artifact@v4 | |
with: | |
name: atomvm-js-web | |
path: src/platforms/emscripten/build | |
- name: Download emscripten test modules | |
uses: actions/download-artifact@v4 | |
with: | |
name: emscripten-test-modules | |
path: src/platforms/emscripten/build | |
- name: Test using cypress | |
shell: bash | |
run: | | |
set -euxo pipefail | |
cd build | |
chmod +x ./src/AtomVM | |
./src/AtomVM examples/emscripten/wasm_webserver.avm & | |
cd ../src/platforms/emscripten/tests/ | |
docker run --network host -v $PWD:/mnt -w /mnt cypress/included:12.17.1 --browser chrome | |
killall AtomVM | |
- name: "Publish screenshots of failures" | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress-screenshots | |
path: | | |
src/platforms/emscripten/tests/cypress/screenshots/**/*.png | |
retention-days: 7 | |
- name: "Rename and write sha256sum (web)" | |
if: startsWith(github.ref, 'refs/tags/') | |
shell: bash | |
working-directory: src/platforms/emscripten/build/src | |
run: | | |
ATOMVM_JS=AtomVM-web-${{ github.ref_name }}.js | |
mv AtomVM.js "${ATOMVM_JS}" | |
sha256sum "${ATOMVM_JS}" > "${ATOMVM_JS}.sha256" | |
ATOMVM_WORKER_JS=AtomVM.worker-web-${{ github.ref_name }}.js | |
mv AtomVM.worker.js "${ATOMVM_WORKER_JS}" | |
sha256sum "${ATOMVM_WORKER_JS}" > "${ATOMVM_WORKER_JS}.sha256" | |
ATOMVM_WASM=AtomVM-web-${{ github.ref_name }}.wasm | |
mv AtomVM.wasm "${ATOMVM_WASM}" | |
sha256sum "${ATOMVM_WASM}" > "${ATOMVM_WASM}.sha256" | |
- name: "Release (web)" | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
fail_on_unmatched_files: true | |
files: | | |
src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.js | |
src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.js.sha256 | |
src/platforms/emscripten/build/src/AtomVM.worker-web-${{ github.ref_name }}.js | |
src/platforms/emscripten/build/src/AtomVM.worker-web-${{ github.ref_name }}.js.sha256 | |
src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.wasm | |
src/platforms/emscripten/build/src/AtomVM-web-${{ github.ref_name }}.wasm.sha256 |