Skip to content
Draft

gha test #26746

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
asdf-invalid
version: 2.1

orbs:
Expand Down
20 changes: 20 additions & 0 deletions .github/actions/install-chrome/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Install Chrome'
description: 'Installs Google Chrome'
runs:
using: "composite"
steps:
- name: Download and install Chrome
run: |
if [ -f /usr/bin/google-chrome ]; then
echo "Google Chrome is already installed:"
/usr/bin/google-chrome --version
else
sudo apt-get update
sudo apt-get install -q -y libu2f-udev libvulkan1 xdg-utils
wget -O ~/chrome.deb https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
sudo dpkg -i ~/chrome.deb
echo "Chrome version:"
/usr/bin/google-chrome --version
fi
shell: bash

16 changes: 16 additions & 0 deletions .github/actions/install-node-newest/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Install Node Newest'
description: 'Installs Node v25.4.0'
runs:
using: "composite"
steps:
- name: Download Node
run: |
cd $HOME
wget https://nodejs.org/dist/v25.4.0/node-v25.4.0-linux-x64.tar.xz
tar xf node-v25.4.0-linux-x64.tar.xz
echo "NODE_JS_TEST = [os.path.expanduser('~/node-v25.4.0-linux-x64/bin/node')]" >> $EMSDK/.emscripten
echo "JS_ENGINES = [NODE_JS_TEST]" >> $EMSDK/.emscripten
echo "if os.path.exists(V8_ENGINE[0]): JS_ENGINES.append(V8_ENGINE)" >> $EMSDK/.emscripten
cat $EMSDK/.emscripten
echo "/home/runner/node-v25.4.0-linux-x64/bin" >> $GITHUB_PATH
shell: bash
29 changes: 29 additions & 0 deletions .github/actions/install-node/#action.yml#
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Install Node'
description: 'Downloads and installs a specified version of Node.js'
inputs:
node_version:
description: 'Node version to install'
required: true
default: '25.4.0'

runs:
using: "composite"
steps:
- name: Download and Configure Node
run: |
cd $HOME
case "${{ inputs.node_version }}" in
newest) version="25.4.0" ;;
lts) version="22.21.0" ;;
# Keep this in sync with `OLDEST_SUPPORTED_NODE` in `feature_matrix.py`
oldest) version="18.3.0" ;;
*) version="${{ inputs.node_version }}" ;;
esac
wget https://nodejs.org/dist/v${version}/node-v${version}-linux-x64.tar.xz
tar xf node-v${version}-linux-x64.tar.xz
echo "NODE_JS_TEST = [os.path.expanduser('~/node-v${version}-linux-x64/bin/node')]" >> $EMSDK/.emscripten
echo "JS_ENGINES = [NODE_JS_TEST]" >> $EMSDK/.emscripten
echo "if os.path.exists(V8_ENGINE[0]): JS_ENGINES.append(V8_ENGINE)" >> $EMSDK/.emscripten
cat $EMSDK/.emscripten
echo "/home/runner/node-v${version}-linux-x64/bin" >> $GITHUB_PATH
shell: bash
1 change: 1 addition & 0 deletions .github/actions/install-node/.#action.yml
28 changes: 28 additions & 0 deletions .github/actions/install-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Install Node'
description: 'Downloads and installs a specified version of Node.js'
inputs:
node_version:
description: 'Node version to install'
required: true
default: '25.4.0'

runs:
using: "composite"
steps:
- name: Download and Configure Node
run: |
cd $HOME
case "${{ inputs.node_version }}" in
newest) version="25.4.0" ;;
lts) version="22.21.0" ;;
oldest) version="18.3.0" ;;
*) version="${{ inputs.node_version }}" ;;
esac
wget https://nodejs.org/dist/v${version}/node-v${version}-linux-x64.tar.xz
tar xf node-v${version}-linux-x64.tar.xz
echo "NODE_JS_TEST = [os.path.expanduser('~/node-v${version}-linux-x64/bin/node')]" >> $EMSDK/.emscripten
echo "JS_ENGINES = [NODE_JS_TEST]" >> $EMSDK/.emscripten
echo "if os.path.exists(V8_ENGINE[0]): JS_ENGINES.append(V8_ENGINE)" >> $EMSDK/.emscripten
cat $EMSDK/.emscripten
echo "/home/runner/node-v${version}-linux-x64/bin" >> $GITHUB_PATH
shell: bash
14 changes: 14 additions & 0 deletions .github/actions/install-v8/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Install V8'
description: 'Installs V8 via jsvu'
runs:
using: "composite"
steps:
- name: Get V8
run: |
cd $HOME
wget https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-x64.tar.xz
tar -xf node-v15.14.0-linux-x64.tar.xz
export PATH="`pwd`/node-v15.14.0-linux-x64/bin:${PATH}"
npm install jsvu -g
jsvu --os=default --engines=v8
shell: bash
50 changes: 50 additions & 0 deletions .github/actions/prepare-for-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 'Prepare for Tests'
description: 'Prepares the environment for running Emscripten tests'
runs:
using: "composite"
steps:
- name: Install Emsdk
uses: emscripten-core/setup-emsdk@v16
with:
version: tot

- name: Attach workspace
uses: actions/download-artifact@v4
with:
name: emscripten-cache
path: ~/

- name: Extract persistent directories
run: tar -xzf ~/emscripten-cache.tar.gz -C ~/
shell: bash

- name: Set EM_CONFIG
run: echo "EM_CONFIG=$EMSDK/.emscripten" >> $GITHUB_ENV
shell: bash

- 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
shell: bash

- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache
shell: bash

- name: Pip install
run: python -m pip install -r requirements-dev.txt
shell: bash

- name: Bootstrap
run: ./bootstrap
shell: bash
218 changes: 218 additions & 0 deletions .github/workflows/#build-and-test-linux.yml#
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
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: ubuntu-latest
env:
EMCC_CORES: "4"
EMCC_USE_NINJA: "1"
EM_COMPILER_WRAPPER: "ccache"
steps:
- name: Checkout repo
uses: actions/checkout@v4

- 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
run: |
cd $HOME
wget https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-x64.tar.xz
tar -xf node-v15.14.0-linux-x64.tar.xz
export PATH="`pwd`/node-v15.14.0-linux-x64/bin:${PATH}"
npm install jsvu -g
jsvu --os=default --engines=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 Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache

- 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@v4

- name: Install Emsdk
uses: emscripten-core/setup-emsdk@v16
with:
version: tot

- name: Attach workspace
uses: actions/download-artifact@v4
with:
name: emscripten-cache
path: ~/

- name: Extract persistent directories
run: tar -xzf ~/emscripten-cache.tar.gz -C ~/

- 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 Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache

- name: Pip install
run: python -m pip install -r requirements-dev.txt

- name: Bootstrap
run: ./bootstrap

- name: Run sanity tests
run: ./test/runner sanity

test-core0:
needs: build-linux
runs-on: ubuntu-latest
env:
EMCC_CORES: "4"
EMTEST_SKIP_NODE_25: "1"
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Emsdk
uses: emscripten-core/setup-emsdk@v16
with:
version: tot

- name: Attach workspace
uses: actions/download-artifact@v4
with:
name: emscripten-cache
path: ~/

- name: Extract persistent directories
run: tar -xzf ~/emscripten-cache.tar.gz -C ~/

- 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 Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache

- name: Pip install
run: python -m pip install -r requirements-dev.txt

- name: Bootstrap
run: ./bootstrap

- name: Run core0 tests
run: ./test/runner core0

Loading
Loading