2023-08-07 13:17:29 +00:00
|
|
|
name: Run test262 and test-wasm
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
env:
|
|
|
|
SERENITY_SOURCE_DIR: ${{ github.workspace }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run_and_update_results:
|
|
|
|
runs-on: self-hosted
|
2024-05-30 21:06:21 +00:00
|
|
|
if: false
|
|
|
|
#if: always() && github.repository == 'LadybirdWebBrowser/ladybird' && github.ref == 'refs/heads/master'
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
concurrency: libjs-test262
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Cleanup
|
|
|
|
run: |
|
|
|
|
echo "Cleaning up previous run"
|
|
|
|
rm -rf "${{ github.workspace }}/*"
|
|
|
|
|
2024-05-30 21:06:21 +00:00
|
|
|
- name: Checkout LadybirdWebBrowser/ladybird
|
2023-09-11 01:51:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
- name: Checkout SerenityOS/libjs-test262
|
2023-09-11 01:51:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-08-07 13:17:29 +00:00
|
|
|
with:
|
|
|
|
repository: SerenityOS/libjs-test262
|
|
|
|
path: libjs-test262
|
|
|
|
|
2023-10-31 15:13:00 +00:00
|
|
|
- name: Checkout SerenityOS/libjs-data
|
2023-09-11 01:51:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-08-07 13:17:29 +00:00
|
|
|
with:
|
2023-10-31 15:13:00 +00:00
|
|
|
repository: SerenityOS/libjs-data
|
|
|
|
path: libjs-data
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
- name: Checkout tc39/test262
|
2023-09-11 01:51:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-08-07 13:17:29 +00:00
|
|
|
with:
|
|
|
|
repository: tc39/test262
|
|
|
|
path: test262
|
|
|
|
|
|
|
|
- name: Checkout tc39/test262-parser-tests
|
2023-09-11 01:51:11 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-08-07 13:17:29 +00:00
|
|
|
with:
|
|
|
|
repository: tc39/test262-parser-tests
|
|
|
|
path: test262-parser-tests
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-02-05 10:45:43 +00:00
|
|
|
sudo apt-get install -y ninja-build unzip gcc-13 g++-13 jq wget
|
2023-08-07 13:17:29 +00:00
|
|
|
test -e /opt/wabt-1.0.27 || (
|
|
|
|
cd /tmp
|
|
|
|
wget https://github.com/WebAssembly/wabt/releases/download/1.0.27/wabt-1.0.27-ubuntu.tar.gz
|
|
|
|
sudo tar xf wabt-1.0.27-ubuntu.tar.gz -C /opt
|
|
|
|
rm wabt-1.0.27-ubuntu.tar.gz
|
|
|
|
)
|
|
|
|
|
|
|
|
- name: Setup Python
|
2023-12-11 01:26:58 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-08-07 13:17:29 +00:00
|
|
|
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: Check versions
|
2024-02-05 10:45:43 +00:00
|
|
|
run: set +e; g++ --version; g++-13 --version; python --version; python3 --version; ninja --version
|
2023-08-07 13:17:29 +00:00
|
|
|
|
2024-05-02 18:38:23 +00:00
|
|
|
- name: Restore Caches
|
|
|
|
uses: ./.github/actions/cache-restore
|
2023-08-07 13:17:29 +00:00
|
|
|
with:
|
2024-05-02 18:38:23 +00:00
|
|
|
os: 'Linux'
|
|
|
|
arch: 'Lagom'
|
|
|
|
download_cache_path: ${{ github.workspace }}/libjs-test262/Build/caches
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
- name: Get previous results
|
|
|
|
run: |
|
2023-10-31 15:13:00 +00:00
|
|
|
mkdir -p old-libjs-data
|
|
|
|
cp -R libjs-data/test262 libjs-data/wasm old-libjs-data
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
- name: Build test262-runner, test-js and test-wasm
|
|
|
|
working-directory: libjs-test262
|
|
|
|
run: |
|
|
|
|
env PATH="/opt/wabt-1.0.27/bin:$PATH" \
|
2023-08-14 19:32:31 +00:00
|
|
|
cmake -GNinja -B Build \
|
2024-02-05 10:45:43 +00:00
|
|
|
-DCMAKE_C_COMPILER=gcc-13 \
|
|
|
|
-DCMAKE_CXX_COMPILER=g++-13 \
|
2023-08-14 19:32:31 +00:00
|
|
|
-DWASM_SPEC_TEST_SKIP_FORMATTING=ON \
|
|
|
|
-DINCLUDE_WASM_SPEC_TESTS=ON \
|
|
|
|
-DSERENITY_SOURCE_DIR=${{ env.SERENITY_SOURCE_DIR }} \
|
|
|
|
-DSERENITY_CACHE_DIR=Build/caches
|
2023-08-07 13:17:29 +00:00
|
|
|
ninja -C 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 \
|
2023-10-31 15:13:00 +00:00
|
|
|
--results-json ../libjs-data/test262/results.json \
|
2024-02-19 12:59:58 +00:00
|
|
|
--per-file-output ../libjs-data/test262/per-file-master.json
|
2023-11-05 14:02:31 +00:00
|
|
|
|
2023-08-07 13:17:29 +00:00
|
|
|
- name: Run test-wasm
|
|
|
|
working-directory: libjs-test262
|
|
|
|
run: |
|
2023-10-31 15:13:00 +00:00
|
|
|
Build/bin/test-wasm --per-file Build/_deps/lagom-build/Userland/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
|
2023-08-07 13:17:29 +00:00
|
|
|
\$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
|
2023-10-31 15:13:00 +00:00
|
|
|
mv wasm-new-results.json ../libjs-data/wasm/results.json
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
- name: Compare test262 results
|
2023-10-31 15:13:00 +00:00
|
|
|
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
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
- name: Compare Wasm results
|
2023-10-31 15:13:00 +00:00
|
|
|
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
|
2023-08-07 13:17:29 +00:00
|
|
|
|
|
|
|
- name: Deploy to GitHub
|
2024-05-20 01:58:28 +00:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.6.1
|
2023-08-07 13:17:29 +00:00
|
|
|
with:
|
|
|
|
git-config-name: BuggieBot
|
|
|
|
git-config-email: buggiebot@serenityos.org
|
|
|
|
branch: master
|
2023-10-31 15:13:00 +00:00
|
|
|
repository-name: SerenityOS/libjs-data
|
2023-08-07 13:17:29 +00:00
|
|
|
token: ${{ secrets.BUGGIEBOT_TOKEN }}
|
2023-10-31 15:13:00 +00:00
|
|
|
folder: libjs-data
|