blob: 81e7aa0d58d13216efb2793233ec25db90b0b4f9 [file] [log] [blame] [edit]
version: 2.1
orbs:
win: circleci/windows@1.0.0
executors:
bionic:
docker:
- image: emscripten/emscripten-ci
environment:
LANG: "C.UTF-8"
EMTEST_DETECT_TEMPFILE_LEAKS: "1"
EMCC_CORES: "4"
EMSDK_NOTTY: "1"
PYTHON_BIN: "python3"
mac:
environment:
EMSDK_NOTTY: "1"
PYTHON_BIN: "python3"
macos:
xcode: "9.0"
commands:
npm-install:
description: "npm ci"
steps:
- run:
name: npm ci
command: |
# Will add emsdk version of node to PATH
source ~/emsdk-master/emsdk_env.sh
npm ci
build-upstream:
description: "Install emsdk build all libraries using embuilder"
steps:
- run:
name: install emsdk
command: |
curl -# -L -o ~/emsdk-master.tar.gz https://github.com/emscripten-core/emsdk/archive/master.tar.gz
tar -C ~ -xf ~/emsdk-master.tar.gz
cd ~/emsdk-master
./emsdk update-tags
./emsdk install tot-upstream
./emsdk activate tot-upstream
# Remove the emsdk version of emscripten to save space in the
# persistent workspace and to avoid any confusion with the version
# we are trying to test.
rm -Rf emscripten
echo "import os" >> ~/.emscripten
# test v8 with --wasm-staging which enables new features. we use v8
# as a "bleeding edge" shell here, basically, with node being the
# primary shell (which we run without any special flags)
echo "V8_ENGINE = [os.path.expanduser('~/.jsvu/v8'), '--wasm-staging']" >> ~/.emscripten
echo "JS_ENGINES = [NODE_JS]" >> ~/.emscripten
echo "if os.path.exists(V8_ENGINE[0]): JS_ENGINES.append(V8_ENGINE)" >> ~/.emscripten
echo "WASM_ENGINES = []" >> ~/.emscripten
test -f ~/vms/wasmtime && echo "WASMTIME = os.path.expanduser(os.path.join('~', 'vms', 'wasmtime')) ; WASM_ENGINES.append(WASMTIME)" >> ~/.emscripten || true
test -f ~/vms/wasmer && echo "WASMER = os.path.expanduser(os.path.join('~', 'vms', 'wasmer')) ; WASM_ENGINES.append(WASMER)" >> ~/.emscripten || true
cd -
echo "final .emscripten:"
cat ~/.emscripten
# Remove any system libs the emsdk installed: we want to rebuild
# them all from source here, to check whether new changes work.
rm -Rf ~/.emscripten_cache
- run:
name: embuilder build ALL
command: |
$PYTHON_BIN ./embuilder.py build ALL
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: embuilder (LTO)
command: |
$PYTHON_BIN ./embuilder.py build MINIMAL --lto
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: embuilder (PIC)
command: |
$PYTHON_BIN ./embuilder.py build SYSTEM --pic
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: embuilder (PIC+LTO)
command: |
$PYTHON_BIN ./embuilder.py build MINIMAL --pic --lto
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: freeze cache
command: |
echo "FROZEN_CACHE=True" >> ~/.emscripten
- npm-install
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: ~/
# Must be relative path from root
paths:
- emsdk-master/
- .emscripten_cache/
- .emscripten_ports/
- .emscripten
- vms
- .jsvu
run-tests:
description: "Runs emscripten tests"
parameters:
test_targets:
description: "Test suites to run"
type: string
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: run tests
command: |
$PYTHON_BIN tests/runner.py << parameters.test_targets >>
$PYTHON_BIN tools/check_clean.py
run-tests-mac:
description: "Runs emscripten tests"
parameters:
test_targets:
description: "Test suites to run"
type: string
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: Install brew package dependencies
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
command: brew install python3 cmake
- run:
name: run tests
command: |
python3 tests/runner.py << parameters.test_targets >>
tools/check_clean.py
test-firefox:
description: "Runs emscripten tests under firefox"
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: download firefox
command: |
wget -O ~/ff.tar.bz2 "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US"
tar -C ~ -xf ~/ff.tar.bz2
- run:
name: configure firefox
command: |
mkdir ~/tmp-firefox-profile/
cat > ~/tmp-firefox-profile/user.js \<<EOF
user_pref("gfx.offscreencanvas.enabled", true);
user_pref("javascript.options.shared_memory", true);
user_pref("dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", true);
EOF
- run:
name: configure openbox
command: |
# Set up X and Openbox config (if we move to a headless browser, this may not be needed).
mkdir -p ~/.config/X11
cat > ~/.config/X11/xorg.conf \<<EOF
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
EndSection
Section "Monitor"
Identifier "Monitor0"
HorizSync 72
Modeline "1920x1080@60" 144 1920 1920 1960 2000 1080 1080 1140 1200
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 1048576
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080@60"
EndSubSection
EndSection
EOF
mkdir -p ~/.config/openbox
echo "[ -f \"\$EXTRA_AUTOSTART\" ] && sh \"\$EXTRA_AUTOSTART\"" > ~/.config/openbox/autostart
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/at-spi-dbus-bus.desktop \<<EOF
[Desktop Entry]
Type=Application
Name=AT-SPI D-Bus Bus
Hidden=true # do not auto-start AT-SPI to suppress one warning
EOF
- run:
# browser.test_sdl2_mouse and/or SDL2 should be fixed. The case happens
# to be failing here, and the root cause might be related with the
# initial position of the mouse pointer relative to the canvas.
# browser.test_html5_webgl_create_context is skipped because
# anti-aliasing is not well supported.
# browser.test_webgl_offscreen_canvas_in_pthread and
# browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread
# are crashing Firefox (bugzil.la/1281796). The former case is
# further blocked by issue #6897.
# TODO: use Firefox headless mode when https://bugzil.la/1375585 resolves
name: run tests
environment:
GALLIUM_DRIVER: softpipe # TODO: use the default llvmpipe when it supports more extensions
EMTEST_LACKS_SOUND_HARDWARE: "1"
# OffscreenCanvas support is not yet done in Firefox.
EMTEST_LACKS_OFFSCREEN_CANVAS: "1"
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
DISPLAY: ":0"
command: |
export EMTEST_BROWSER="$HOME/firefox/firefox -profile $HOME/tmp-firefox-profile/"
# Start an X session. Openbox might be optional for now, but
# an ICCCM/EWMH compliant window manager is potentially needed
# for tests with fullscreen toggling (if we move to a headless
# browser, this may not be needed eventually).
TMPDIR=`mktemp -d`
mkfifo $TMPDIR/fifo
echo "echo -n > $TMPDIR/fifo" > $TMPDIR/autostart
EXTRA_AUTOSTART=$TMPDIR/autostart startx /usr/bin/openbox-session -- $DISPLAY -config ~/.config/X11/xorg.conf -nolisten tcp &
cat $TMPDIR/fifo > /dev/null # wait until $EXTRA_AUTOSTART is spawned, which indicates the end of Openbox initialization
rm -r $TMPDIR
python3 tests/runner.py browser skip:browser.test_sdl2_mouse skip:browser.test_html5_webgl_create_context skip:browser.test_webgl_offscreen_canvas_in_pthread skip:browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread skip:browser.test_glut_glutget
openbox --exit
wait || true # wait for startx to shutdown cleanly, or not
test-chrome:
description: "Runs emscripten browser tests under chrome"
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: download chrome
command: |
wget -O ~/chrome.deb https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
dpkg -i ~/chrome.deb
- run:
name: run tests
environment:
EMTEST_LACKS_SOUND_HARDWARE: "1"
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
# --no-sandbox becasue we are running as root and chrome requires
# this flag for now: https://crbug.com/638180
CHROME_FLAGS_BASE: "--no-first-run -start-maximized --no-sandbox --use-gl=swiftshader --user-data-dir=/tmp/chrome-emscripten-profile"
CHROME_FLAGS_HEADLESS: "--headless --remote-debugging-port=1234"
CHROME_FLAGS_WASM: "--enable-features=WebAssembly --enable-features=SharedArrayBuffer --disable-features=WebAssemblyTrapHandler --js-flags=\"--experimental-wasm-threads --harmony-sharedarraybuffer --no-wasm-disable-structured-cloning\""
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
command: |
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"
# skip test_zzz_zzz_4GB_fail as it OOMs on the current bot
python3 tests/runner.py browser skip:browser.test_zzz_zzz_4GB_fail
test-upstream-sockets-chrome:
description: "Runs emscripten sockets tests under chrome"
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- run:
name: download chrome
command: |
wget -O ~/chrome.deb https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
dpkg -i ~/chrome.deb
- checkout
- npm-install
- run:
name: run sockets tests
environment:
EMTEST_LACKS_SOUND_HARDWARE: "1"
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
# --no-sandbox becasue we are running as root and chrome requires
# this flag for now: https://crbug.com/638180
CHROME_FLAGS_BASE: "--no-first-run -start-maximized --no-sandbox --use-gl=swiftshader --user-data-dir=/tmp/chrome-emscripten-profile"
CHROME_FLAGS_HEADLESS: "--headless --remote-debugging-port=1234"
CHROME_FLAGS_WASM: "--enable-features=WebAssembly --enable-features=SharedArrayBuffer --disable-features=WebAssemblyTrapHandler --js-flags=\"--experimental-wasm-threads --harmony-sharedarraybuffer --no-wasm-disable-structured-cloning\""
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
command: |
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"
python3 tests/runner.py sockets
jobs:
build-fastcomp:
executor: bionic
steps:
- checkout
- run:
name: install emsdk
command: |
curl -# -L -o ~/emsdk-master.tar.gz https://github.com/emscripten-core/emsdk/archive/master.tar.gz
tar -C ~ -xf ~/emsdk-master.tar.gz
cd ~/emsdk-master
./emsdk update-tags
./emsdk install tot-fastcomp
./emsdk activate tot-fastcomp
# Remove the emsdk version of emscripten to save space in the
# persistent workspace and to avoid any confusion with the version
# we are trying to test.
rm -Rf emscripten
cd -
echo "final .emscripten:"
cat ~/.emscripten
# Remove any system libs the emsdk installed: we want to rebuild
# them all from source here, to check whether new changes work.
rm -Rf ~/.emscripten_cache
- run:
name: embuilder build ALL
command: |
python3 ./embuilder.py build ALL
python3 tests/runner.py test_hello_world
- run:
name: freeze cache
command: |
echo "FROZEN_CACHE=True" >> ~/.emscripten
- npm-install
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: ~/
# Must be relative path from root
paths:
- emsdk-master/
- .emscripten_cache/
- .emscripten_ports/
- .emscripten
build-docs:
executor: bionic
steps:
- checkout
- run: make -C site html
flake8:
executor: bionic
steps:
- checkout
- run: python2 -m flake8 --show-source --statistics
- run: python3 -m flake8 --show-source --statistics
test-other:
executor: bionic
steps:
- run-tests:
# some native-dependent tests fail because of the lack of native
# headers on emsdk-bundled clang>
# CircleCI actively kills memory-over-consuming process skip llvm-lit
# tests which need lit, and pip to get lit, but pip has broken on CI
test_targets: "other skip:other.test_native_link_error_message skip:other.test_emcc_v"
test-browser-firefox:
executor: bionic
steps:
- test-firefox
test-browser-chrome:
executor: bionic
steps:
- test-chrome
test-ab:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_a* asm*.test_b*"
test-c:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_c*"
test-d:
executor: bionic
steps:
- run-tests:
test_targets: "default.test_d* asm1.test_d* asm2.test_d* asm2g.test_d* asm3.test_d*"
test-e:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_e*"
test-f:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_f*"
test-ghi:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_g* asm*.test_h* asm*.test_i*"
test-jklmno:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_j* asm*.test_k* asm*.test_l* asm*.test_m* asm*.test_n* asm*.test_o*"
test-p:
executor: bionic
steps:
- run-tests:
test_targets: "default.test_p* asm1.test_p* asm2.test_p* asm2g.test_p* asm3.test_p*"
test-qrst:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_q* asm*.test_r* asm*.test_s* asm*.test_t*"
test-uvwxyz:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_u* asm*.test_w* asm*.test_v* asm*.test_x* asm*.test_y* asm*.test_z*"
test-wasm0:
executor: bionic
steps:
- run-tests:
test_targets: "wasm0"
test-wasm2:
executor: bionic
steps:
- run-tests:
test_targets: "wasm2"
test-wasm3:
executor: bionic
steps:
- run-tests:
test_targets: "wasm3"
test-sanity:
executor: bionic
steps:
- run-tests:
test_targets: "sanity"
build-upstream-linux:
executor: bionic
steps:
- checkout
- run:
name: get wasmer
command: |
wget https://github.com/wasmerio/wasmer/releases/download/0.11.0/wasmer-linux-amd64.tar.gz
tar -xf wasmer-linux-amd64.tar.gz
mkdir ~/vms
cp bin/wasmer ~/vms
- run:
name: get wasmtime
command: |
# use a pinned version due to https://github.com/bytecodealliance/wasmtime/issues/714
export VERSION=v0.8.0
wget https://github.com/bytecodealliance/wasmtime/releases/download/v0.8.0/wasmtime-$VERSION-x86_64-linux.tar.xz
tar -xf wasmtime-$VERSION-x86_64-linux.tar.xz
cp wasmtime-$VERSION-x86_64-linux/wasmtime ~/vms
- run:
name: get v8
command: |
wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz
tar -xf node-v12.13.0-linux-x64.tar.xz
export PATH="`pwd`/node-v12.13.0-linux-x64/bin:${PATH}"
npm install jsvu -g
export PATH="${HOME}/.jsvu:${PATH}"
jsvu --os=default --engines=v8
- build-upstream
test-upstream-wasm0:
executor: bionic
steps:
- run-tests:
test_targets: "wasm0"
test-upstream-wasm2:
executor: bionic
steps:
- run-tests:
test_targets: "wasm2"
test-upstream-wasm3:
executor: bionic
steps:
- run-tests:
# TODO: test wasms
test_targets: "wasm3"
test-upstream-wasm2js1:
executor: bionic
steps:
- run-tests:
test_targets: "wasm2js1"
test-upstream-other:
executor: bionic
steps:
- run-tests:
# see explanations in the fastcomp skips for these, earlier
test_targets: "other skip:other.test_native_link_error_message skip:other.test_emcc_v"
test-upstream-browser-chrome:
executor: bionic
steps:
- test-chrome
test-upstream-browser-firefox:
executor: bionic
steps:
- test-firefox
test-upstream-sockets-chrome:
executor: bionic
steps:
- test-upstream-sockets-chrome
build-upstream-windows:
executor:
name: win/vs2019
shell: bash.exe
environment:
# We need python installed before we can test anytyhing.
# There seems to be undocument copy of python installed here. Hopefully
# if this disappears there will be another way of getting a re-installed
# version.
PYTHON_BIN: "/c/python27amd64/python.exe"
PYTHONUNBUFFERED: "1"
EMSDK_NOTTY: "1"
steps:
- checkout
- run:
name: Add python to bash path
command: echo "export PATH=\"$PATH:/c/python27amd64/\"" >> $BASH_ENV
- build-upstream
test-upstream-minimal-windows:
environment:
PYTHON_BIN: "/c/python27amd64/python.exe"
PYTHONUNBUFFERED: "1"
EMSDK_NOTTY: "1"
executor:
name: win/vs2019
shell: bash.exe
steps:
- run-tests:
test_targets: "wasm2.test_ccall other.test_closure_externs other.test_binaryen_debug"
build-upstream-mac:
executor: mac
steps:
- run:
name: Install brew package dependencies
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
command: brew install python3 cmake
- checkout
- build-upstream
test-upstream-other-mac:
executor: mac
steps:
- run-tests-mac:
test_targets: "other wasm0.test_lua skip:other.test_native_link_error_message skip:other.test_emcc_v"
workflows:
build-test:
jobs:
- flake8
- build-docs
- build-fastcomp
- test-other:
requires:
- build-fastcomp
- test-browser-firefox:
requires:
- build-fastcomp
- test-browser-chrome:
requires:
- build-fastcomp
- test-ab:
requires:
- build-fastcomp
- test-c:
requires:
- build-fastcomp
- test-d:
requires:
- build-fastcomp
- test-e:
requires:
- build-fastcomp
- test-f:
requires:
- build-fastcomp
- test-ghi:
requires:
- build-fastcomp
- test-jklmno:
requires:
- build-fastcomp
- test-p:
requires:
- build-fastcomp
- test-qrst:
requires:
- build-fastcomp
- test-uvwxyz:
requires:
- build-fastcomp
- test-wasm0:
requires:
- build-fastcomp
- test-wasm2:
requires:
- build-fastcomp
- test-wasm3:
requires:
- build-fastcomp
- test-sanity:
requires:
- build-fastcomp
- build-upstream-linux
- test-upstream-wasm0:
requires:
- build-upstream-linux
- test-upstream-wasm2:
requires:
- build-upstream-linux
- test-upstream-wasm3:
requires:
- build-upstream-linux
- test-upstream-wasm2js1:
requires:
- build-upstream-linux
- test-upstream-other:
requires:
- build-upstream-linux
- test-upstream-browser-chrome:
requires:
- build-upstream-linux
- test-upstream-browser-firefox:
requires:
- build-upstream-linux
- test-upstream-sockets-chrome:
requires:
- build-upstream-linux
- build-upstream-windows
- test-upstream-minimal-windows:
requires:
- build-upstream-windows
- build-upstream-mac
- test-upstream-other-mac:
requires:
- build-upstream-mac