mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
Their cache action only works on their runners. For jobs that run on other runners, we have use the default cache action. At least until they update their cache product to work or fallback on other runners.
159 lines
5.8 KiB
YAML
159 lines
5.8 KiB
YAML
name: Run test262 and test-wasm
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
|
|
env:
|
|
LADYBIRD_SOURCE_DIR: ${{ github.workspace }}
|
|
VCPKG_ROOT: ${{ github.workspace }}/Build/vcpkg
|
|
|
|
jobs:
|
|
run_and_update_results:
|
|
runs-on: test262-runner
|
|
if: github.repository == 'LadybirdBrowser/ladybird'
|
|
|
|
concurrency: libjs-test262
|
|
|
|
steps:
|
|
- name: Cleanup
|
|
run: |
|
|
echo "Cleaning up previous run"
|
|
rm -rf "${{ github.workspace }}/*"
|
|
|
|
- name: Checkout LadybirdBrowser/ladybird
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Checkout LadybirdBrowser/libjs-test262
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: LadybirdBrowser/libjs-test262
|
|
path: libjs-test262
|
|
|
|
- name: Checkout LadybirdBrowser/libjs-data
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: LadybirdBrowser/libjs-data
|
|
path: libjs-data
|
|
|
|
- name: Checkout tc39/test262
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: tc39/test262
|
|
path: test262
|
|
|
|
- name: Checkout tc39/test262-parser-tests
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: tc39/test262-parser-tests
|
|
path: test262-parser-tests
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build unzip clang-20 clang++-20 jq curl zip tar autoconf autoconf-archive automake nasm pkg-config libgl1-mesa-dev rsync
|
|
|
|
test -e /opt/wabt-1.0.35 || (
|
|
cd /tmp
|
|
curl -f -L -o wabt-1.0.35-ubuntu-20.04.tar.gz https://github.com/WebAssembly/wabt/releases/download/1.0.35/wabt-1.0.35-ubuntu-20.04.tar.gz
|
|
sudo tar xf wabt-1.0.35-ubuntu-20.04.tar.gz -C /opt
|
|
rm wabt-1.0.35-ubuntu-20.04.tar.gz
|
|
)
|
|
|
|
# FIXME: Just use the setup action
|
|
./Toolchain/BuildVcpkg.py --ci
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install Python dependencies
|
|
# The setup-python action set default python to python3.x. Note that we are not using system python here.
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r libjs-test262/requirements.txt
|
|
|
|
- name: Restore Caches
|
|
uses: ./.github/actions/cache-restore
|
|
with:
|
|
runner_label: test262-runner
|
|
os: 'Linux'
|
|
arch: 'Lagom'
|
|
download_cache_path: ${{ github.workspace }}/libjs-test262/Build/caches
|
|
|
|
- name: Get previous results
|
|
run: |
|
|
mkdir -p old-libjs-data
|
|
cp -R libjs-data/test262 libjs-data/wasm old-libjs-data
|
|
|
|
- name: Build test262-runner, test-js and test-wasm
|
|
run: |
|
|
# FIXME: Why does vcpkg need this?
|
|
# Running as a normal user would make this a non-issue though
|
|
export HOME=${{ github.workspace }}/home
|
|
mkdir -p $HOME
|
|
env PATH="/opt/wabt-1.0.35/bin:$PATH" \
|
|
CC=clang-20 \
|
|
CXX=clang++-20 \
|
|
cmake --preset CI -B libjs-test262/Build \
|
|
-DCMAKE_C_COMPILER=clang-20 \
|
|
-DCMAKE_CXX_COMPILER=clang++-20 \
|
|
-DWASM_SPEC_TEST_SKIP_FORMATTING=ON \
|
|
-DINCLUDE_WASM_SPEC_TESTS=ON \
|
|
-DENABLE_GUI_TARGETS=OFF
|
|
ninja -C libjs-test262/Build test262-runner test-js test-wasm
|
|
|
|
- name: Run test262 and test262-parser-tests
|
|
working-directory: libjs-test262
|
|
run: |
|
|
python3 run_all_and_update_results.py \
|
|
--serenity .. \
|
|
--test262 ../test262 \
|
|
--test262-parser-tests ../test262-parser-tests \
|
|
--results-json ../libjs-data/test262/results.json \
|
|
--per-file-output ../libjs-data/test262/per-file-master.json
|
|
|
|
- name: Run test-wasm
|
|
working-directory: libjs-test262
|
|
run: |
|
|
Build/bin/test-wasm --per-file Build/Lagom/Libraries/LibWasm/Tests > ../libjs-data/wasm/per-file-master.json || true
|
|
jq -nc -f /dev/stdin <<-EOF --slurpfile previous ../libjs-data/wasm/results.json --slurpfile details ../libjs-data/wasm/per-file-master.json > wasm-new-results.json
|
|
\$details[0] as \$details | \$previous[0] + [{
|
|
"commit_timestamp": $(git -C .. log -1 --format=%ct),
|
|
"run_timestamp": $(date +%s),
|
|
"versions": {
|
|
"serenity": "$(git -C .. rev-parse HEAD)"
|
|
},
|
|
"tests": {
|
|
"spectest": {
|
|
"duration": (\$details.duration),
|
|
"results": {
|
|
"total": (\$details.results | keys | length),
|
|
"passed": ([\$details.results | values[] | select(. == "PASSED")] | length),
|
|
"failed": ([\$details.results | values[] | select(. == "FAILED")] | length),
|
|
"skipped": ([\$details.results | values[] | select(. == "SKIPPED")] | length),
|
|
"process_error": ([\$details.results | values[] | select(. == "PROCESS_ERROR")] | length)
|
|
}
|
|
}
|
|
}
|
|
}]
|
|
EOF
|
|
mv wasm-new-results.json ../libjs-data/wasm/results.json
|
|
|
|
- name: Compare test262 results
|
|
run: ./libjs-test262/per_file_result_diff.py -o old-libjs-data/test262/per-file-master.json -n libjs-data/test262/per-file-master.json
|
|
|
|
- name: Compare Wasm results
|
|
run: ./libjs-test262/per_file_result_diff.py -o old-libjs-data/wasm/per-file-master.json -n libjs-data/wasm/per-file-master.json
|
|
|
|
- name: Deploy to GitHub
|
|
uses: JamesIves/github-pages-deploy-action@v4.7.3
|
|
with:
|
|
git-config-name: LadybirdBot
|
|
git-config-email: ladybirdbot@ladybird.org
|
|
branch: master
|
|
repository-name: LadybirdBrowser/libjs-data
|
|
token: ${{ secrets.LADYBIRD_BOT_TOKEN }}
|
|
folder: libjs-data
|