Skip to content

gha test

gha test #31

name: Linux Build and Test
on:
create:
tags:
push:
branches:
- main
pull_request:
env:
LANG: "C.UTF-8"
EMSDK_NOTTY: "1"
EMTEST_WASI_SYSROOT: "/home/runner/wasi-sdk/wasi-sysroot"
EMTEST_DETECT_TEMPFILE_LEAKS: "1"
PYTHONUNBUFFERED: "1"
permissions:
contents: read
jobs:
build-linux:
runs-on: emscripten-premerge-linux-runners
env:
EMCC_CORES: "4"
EMCC_USE_NINJA: "1"
EM_COMPILER_WRAPPER: "ccache"
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Install Basic Packages
uses: ./.github/actions/install-basic-packages
- name: Get wasmer
run: |
wget https://github.com/wasmerio/wasmer/releases/download/v3.1.1/wasmer-linux-amd64.tar.gz
tar -xf wasmer-linux-amd64.tar.gz
mkdir -p ~/vms
cp bin/wasmer ~/vms
- name: Get wasmtime
run: |
export VERSION=v0.33.0
wget https://github.com/bytecodealliance/wasmtime/releases/download/$VERSION/wasmtime-$VERSION-x86_64-linux.tar.xz
tar -xf wasmtime-$VERSION-x86_64-linux.tar.xz
cp wasmtime-$VERSION-x86_64-linux/wasmtime ~/vms
- name: Get wasi-sdk-sysroot
run: |
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/libclang_rt.builtins-wasm32-wasi-11.0.tar.gz
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/wasi-sysroot-11.0.tar.gz
mkdir -p ~/wasi-sdk
tar xf libclang_rt.builtins-wasm32-wasi-11.0.tar.gz -C ~/wasi-sdk
tar xf wasi-sysroot-11.0.tar.gz -C ~/wasi-sdk/
- name: Install V8
uses: ./.github/actions/install-v8
- name: Install Emsdk
uses: emscripten-core/setup-emsdk@v16
with:
version: tot
- name: Set EM_CONFIG
run: |
echo "EM_CONFIG=$EMSDK/.emscripten" >> $GITHUB_ENV
- name: Setup cache config
run: |
echo "import os" >> $EMSDK/.emscripten
echo "CACHE = os.path.expanduser('~/cache')" >> $EMSDK/.emscripten
echo "V8_ENGINE = [os.path.expanduser('~/.jsvu/bin/v8')]" >> $EMSDK/.emscripten
echo "JS_ENGINES = [NODE_JS]" >> $EMSDK/.emscripten
echo "if os.path.exists(V8_ENGINE[0]): JS_ENGINES.append(V8_ENGINE)" >> $EMSDK/.emscripten
echo "WASM_ENGINES = []" >> $EMSDK/.emscripten
test -f ~/vms/wasmtime && echo "WASMTIME = os.path.expanduser(os.path.join('~', 'vms', 'wasmtime')) ; WASM_ENGINES.append(WASMTIME)" >> $EMSDK/.emscripten || true
test -f ~/vms/wasmer && echo "WASMER = os.path.expanduser(os.path.join('~', 'vms', 'wasmer')) ; WASM_ENGINES.append(WASMER)" >> $EMSDK/.emscripten || true
test -d ~/wasi-sdk && cp -a ~/wasi-sdk/lib/ $($EMSDK/upstream/bin/clang -print-resource-dir) || true
- name: Install ccache
run: sudo apt-get install -y ccache
shell: bash
- name: Pip install
run: python -m pip install -r requirements-dev.txt
- name: Bootstrap
run: ./bootstrap
- name: Build libraries
run: |
./emcc --clear-cache
./test/runner test_hello_world
- name: Clean build directory
run: rm -rf ~/cache/build
- name: Archive persistent directories
run: tar -czf ~/emscripten-cache.tar.gz -C ~/ .jsvu cache vms wasi-sdk
- name: Persist workspace
uses: actions/upload-artifact@v4
with:
name: emscripten-cache
path: ~/emscripten-cache.tar.gz
test-sanity:
needs: build-linux
runs-on: ubuntu-latest
env:
EMCC_CORES: "4"
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Prepare for tests
uses: ./.github/actions/prepare-for-tests
- name: Run sanity tests
run: ./test/runner sanity
test-core0:
needs: build-linux
runs-on: emscripten-premerge-linux-runners
env:
EMCC_CORES: "4"
EMTEST_SKIP_NODE_25: "1"
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Prepare for tests
uses: ./.github/actions/prepare-for-tests
- name: Run core0 tests
run: ./test/runner core0
test-wasm64-4gb:
needs: build-linux
runs-on: ubuntu-latest
env:
EMCC_CORES: 4
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Prepare for tests
uses: ./.github/actions/prepare-for-tests
- name: Reinstall V8
run: rm -rf $HOME/.jsvu
shell: bash
- name: Install V8
uses: ./.github/actions/install-v8
- name: Install Node newest
uses: ./.github/actions/install-node
with:
node_version: newest
- name: Configure Node v25
run: echo "NODE_JS = NODE_JS_TEST" >> $EMSDK/.emscripten
shell: bash
- name: Run wasm64_4gb tests
run: ./test/runner wasm64_4gb
shell: bash
test-browser-chrome:
needs: build-linux
runs-on: emscripten-premerge-linux-runners
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Run browser chrome tests
uses: ./.github/actions/run-tests-chrome
with:
title: 'browser-chrome'
test_targets: 'browser.test_gl_stride browser.test_memory_growth_during_startup browser.test_pthread_large_pthread_allocation browser.test_pthread_sbrk* browser.test_pthread_asan* browser.test_webgl_multi_draw* browser.test_pthread_growth* browser.test_4gb browser.test_emmalloc_3gb* browser.test_dlmalloc_3gb browser.test_2gb_fail browser.test_audio_worklet*'
test-browser-chrome-wasm64:
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Run browser64 tests
uses: ./.github/actions/run-tests-chrome
with:
title: 'browser-chrome-wasm64'
test_targets: 'browser64.test_emscripten_animate_canvas_element_size* browser64.test_*malloc_*gb* browser64.test_emmalloc_memgrowth browser64.test_subdata_es2* browser64.test_webgl2_garbage_free_entrypoints* browser64.test_gl_stride browser64.test_webgl2_get_buffer_sub_data browser64.test_webgl2_pbo browser64.test_webgl2_sokol* browser64.test_memory_growth_during_startup browser64.test_pthread_large_pthread_allocation browser64.test_pthread_sbrk* browser64.test_pthread_asan* browser64.test_webgl_multi_draw* browser64.test_pthread_growth*'
visualize: 'true'
test-browser-chrome-2gb:
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Run browser_2gb tests
uses: ./.github/actions/run-tests-chrome
with:
title: 'browser-chrome-2gb'
test_targets: 'browser_2gb'
test-browser-chrome-wasm64-4gb:
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Run browser64_4gb tests
uses: ./.github/actions/run-tests-chrome
with:
title: 'browser-chrome-wasm64-4gb'
test_targets: 'browser64_4gb'
test-sockets-chrome:
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Run sockets tests
uses: ./.github/actions/run-tests-chrome
with:
title: 'sockets-chrome'
test_targets: 'sockets'
test-other:
needs: build-linux
runs-on: ubuntu-latest
env:
EMCC_CORES: "4"
EMTEST_SKIP_NODE_25: "1"
EMTEST_SKIP_RUST: "1"
EMTEST_SKIP_WASM64: "1"
EMTEST_SKIP_NEW_CMAKE: "1"
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Prepare for tests
uses: ./.github/actions/prepare-for-tests
- name: Install Scons
run: |
sudo apt-get update
sudo apt-get install -y scons
shell: bash
- name: Setup Rust target
run: rustup target add wasm32-unknown-emscripten
shell: bash
- name: Run other and jslib tests
run: ./test/runner other jslib skip:other.test_native_link_error_message
shell: bash
- name: Run primes benchmark
run: ./test/runner benchmark.test_primes
shell: bash
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Setup Python
uses: actions/setup-python@v6.2.0
with:
python-version: '3.10'
- name: Pip install
run: python -m pip install -r requirements-dev.txt
shell: bash
- name: Update settings docs check
run: tools/maint/update_settings_docs.py --check
shell: bash
- name: Make site text
run: make -C site text
shell: bash
- name: Check emcc help text
run: tools/maint/check_emcc_help_text.py
shell: bash
- name: Make site html
run: make -C site html
shell: bash
test-modularize-instance:
needs: build-linux
runs-on: ubuntu-latest
env:
EMTEST_SKIP_NODE_25: "1"
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Prepare for tests
uses: ./.github/actions/prepare-for-tests
- name: Run modularize instance tests
run: ./test/runner instance
shell: bash
test-stress:
needs: build-linux
runs-on: ubuntu-latest
env:
EMTEST_SKIP_NODE_25: "1"
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Prepare for tests
uses: ./.github/actions/prepare-for-tests
- name: Run stress tests
run: ./test/runner stress
shell: bash
test-esm-integration:
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Prepare for tests
uses: ./.github/actions/prepare-for-tests
- name: Reinstall V8
run: rm -rf $HOME/.jsvu
shell: bash
- name: Install V8
uses: ./.github/actions/install-v8
- name: Install Node newest
uses: ./.github/actions/install-node
with:
node_version: newest
- name: Run esm_integration tests
run: ./test/runner esm_integration
shell: bash
linters:
runs-on: emscripten-premerge-linux-runners
steps:
- name: Checkout repo
uses: actions/checkout@v6.0.2
- name: Install Basic Packages
uses: ./.github/actions/install-basic-packages
- name: Setup Node.js
uses: actions/setup-node@v6.3.0
with:
node-version: '24.13.1'
- name: Install Python dependencies
run: python -m pip install -r requirements-dev.txt
shell: bash
- name: Run ruff
run: ruff check
shell: bash
- name: Run vulture
run: vulture . --min-confidence 100
shell: bash
- name: Run mypy
run: mypy
shell: bash
- name: Install Node dependencies
run: npm ci
shell: bash
- name: Run eslint (lint)
run: npm run lint
shell: bash
- name: Run eslint (check)
run: npm run check
shell: bash