build,ci: Bump emsdk to 2.0.25, rework separate check for tot (#304)

This commit is contained in:
Alice D 2021-07-02 07:03:28 -04:00 committed by GitHub
parent f9add8c657
commit 7955529bfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 92 additions and 109 deletions

View file

@ -0,0 +1,88 @@
name: 'Test Build (Emscripten Experimental)'
on:
workflow_dispatch:
workflow_run:
workflows: ["Test Builds"]
branches: [master]
types:
- completed
- requested
schedule:
# run every friday at 20:00
- cron: '0 20 * * 5'
env:
MESON_VERSION: '0.56.2'
EM_VERSION: 'tot'
EM_CACHE_FOLDER: 'emsdk'
jobs:
emscripten-weekly-latest:
name: 'Emscripten'
if: "!contains(github.event.head_commit.message, '[skip ci]') && ${{ github.event.workflow_run.conclusion == 'success' }}"
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Tools
run: >
sudo apt update || true
sudo apt install -y -qq
python3-docutils
python3-pip
git
pip install
meson==${{ env.MESON_VERSION }}
ninja
zstandard
- name: Install Emscripten SDK
run: |
git clone https://github.com/emscripten-core/emsdk.git ${{ env.EM_CACHE_FOLDER }}
${{ env.EM_CACHE_FOLDER }}/emsdk install ${{ env.EM_VERSION }} || true
${{ env.EM_CACHE_FOLDER }}/emsdk activate ${{ env.EM_VERSION }}
- name: Verify Emscripten SDK
run: |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
emcc -v
tee misc/ci/emscripten-ephemeral-ci.ini <<EOF >/dev/null
[constants]
toolchain = '$(pwd)/${{ env.EM_CACHE_FOLDER }}/upstream/emscripten/'
EOF
- name: Configure
run: >
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
meson setup build/
--cross-file misc/ci/emscripten-ephemeral-ci.ini
--cross-file misc/ci/emscripten-build-test-ci.ini
--prefix=$(pwd)/build-test
meson configure
-Dbuild.cpp_std=gnu++14
build/
- name: Build
run: |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
meson compile tar -C build/ --verbose
ninja zip -C build/
- name: Upload Log
uses: actions/upload-artifact@v2
with:
name: taisei_emscripten_latest_build_log
path: build/meson-logs/meson-log.txt

View file

@ -20,7 +20,7 @@ on:
env:
MESON_VERSION: '0.56.2'
EM_VERSION: '2.0.21'
EM_VERSION: '2.0.25'
EM_CACHE_FOLDER: 'emsdk'
TAISEI_NOPRELOAD: 0
TAISEI_PRELOAD_REQUIRED: 1
@ -196,7 +196,7 @@ jobs:
if-no-files-found: warn
emscripten-test-build:
name: "Emscripten (emsdk: stable)"
name: "Emscripten"
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
steps:
@ -273,112 +273,6 @@ jobs:
path: build/meson-logs/meson-log.txt
if-no-files-found: warn
emscripten-test-build-latest:
name: "Emscripten (emsdk: latest)"
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- name: Get Latest Emscripten SDK Tag
id: emsdk-tag
run: >
git clone https://github.com/emscripten-core/emsdk.git
git --git-dir=${{ env.EM_CACHE_FOLDER }}/.git fetch --tags
export EM_LATEST_TAG=$(git --git-dir=${{ env.EM_CACHE_FOLDER }}/.git describe --abbrev=0 --tags)
echo EM_LATEST_TAG=$EM_LATEST_TAG >> $GITHUB_ENV
if [[ $EM_LATEST_TAG != ${{ env.EM_VERSION }} ]]; then
echo "Versions differ (latest: $EM_LATEST_TAG, stable: ${{ env.EM_VERSION }}), running test build";
echo '::set-output name=run::true';
else
echo "Same tag as in stable build (latest: $EM_LATEST_TAG, stable: ${{ env.EM_VERSION }}), skipping";
fi
rm -rf ./${{ env.EM_CACHE_FOLDER }} # cleanup
- name: Checkout Code
if: steps.emsdk-tag.outputs.run == 'true'
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install Python
if: steps.emsdk-tag.outputs.run == 'true'
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Tools
if: steps.emsdk-tag.outputs.run == 'true'
run: >
sudo apt update || true
sudo apt install -y -qq
python3-docutils
python3-pip
git
pip install
meson==${{ env.MESON_VERSION }}
ninja
zstandard
- name: Fetch Cached Emscripten SDK
if: steps.emsdk-tag.outputs.run == 'true'
id: emsdk-cache
uses: actions/cache@v2
with:
path: ${{ env.EM_CACHE_FOLDER }}
key: ${{ env.EM_LATEST_TAG }}-${{ runner.os }}
- name: Install Emscripten SDK
if: steps.emsdk-tag.outputs.run == 'true' && steps.emsdk-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/emscripten-core/emsdk.git ${{ env.EM_CACHE_FOLDER }}
${{ env.EM_CACHE_FOLDER }}/emsdk install ${{ env.EM_LATEST_TAG }} || true
${{ env.EM_CACHE_FOLDER }}/emsdk activate ${{ env.EM_LATEST_TAG }}
- name: Verify Emscripten SDK
if: steps.emsdk-tag.outputs.run == 'true'
run: |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
emcc -v
tee misc/ci/emscripten-ephemeral-ci.ini <<EOF >/dev/null
[constants]
toolchain = '$(pwd)/${{ env.EM_CACHE_FOLDER }}/upstream/emscripten/'
EOF
- name: Configure
if: steps.emsdk-tag.outputs.run == 'true'
run: >
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
meson setup build/
--cross-file misc/ci/emscripten-ephemeral-ci.ini
--cross-file misc/ci/emscripten-build-test-ci.ini
--prefix=$(pwd)/build-test
meson configure
-Dbuild.cpp_std=gnu++14
build/
- name: Build
if: steps.emsdk-tag.outputs.run == 'true'
run: |
# this build is allowed to fail
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
meson compile tar -C build/ --verbose
- name: Upload Log
if: steps.emsdk-tag.outputs.run == 'true'
uses: actions/upload-artifact@v2
with:
name: taisei_emscripten_latest_build_log
path: build/meson-logs/meson-log.txt
switch-test-build:
name: Switch (ARM64)
if: "!contains(github.event.head_commit.message, '[skip ci]')"

View file

@ -163,6 +163,7 @@ if host_machine.system() == 'emscripten'
'--js-output=@0@'.format(out_loader), # No, this one does not accept "--js-output foobar.js"
'--use-preload-cache',
'--from-emcc',
'--no-node',
get_variable(var_packer_args)
],
output : data_name,

View file

@ -175,6 +175,7 @@ if host_machine.system() == 'emscripten'
em_link_args = [
'-O@0@'.format(get_option('optimization')),
'-s', 'ALLOW_MEMORY_GROWTH=1',
'-s', 'ALLOW_UNIMPLEMENTED_SYSCALLS=1',
'-s', 'DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=["$autoResumeAudioContext"]',
'-s', 'ENVIRONMENT=web',
'-s', 'EXIT_RUNTIME=0',
@ -193,7 +194,6 @@ if host_machine.system() == 'emscripten'
'-s', 'WASM=1',
'-s', 'LLD_REPORT_UNDEFINED',
'-lGL',
'-lgl',
'-lwebgl.js',
'-legl.js',
'-lidbfs.js',