2021-06-05 15:03:22 +00:00
|
|
|
name: Run test262 with LibJS and push results to the website repo
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
env:
|
|
|
|
SERENITY_SOURCE_DIR: ${{ github.workspace }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run_and_update_results:
|
2021-07-03 16:19:02 +00:00
|
|
|
runs-on: self-hosted
|
2021-06-05 15:03:22 +00:00
|
|
|
if: always() && github.repository == 'SerenityOS/serenity' && github.ref == 'refs/heads/master'
|
|
|
|
|
|
|
|
concurrency: libjs-test262
|
|
|
|
|
|
|
|
steps:
|
2021-07-03 18:36:49 +00:00
|
|
|
- name: Cleanup
|
|
|
|
run: |
|
|
|
|
echo "Cleaning up previous run"
|
|
|
|
rm -rf "${{ github.workspace }}/*"
|
|
|
|
|
2021-06-05 15:03:22 +00:00
|
|
|
- name: Checkout SerenityOS/serenity
|
2022-11-03 06:01:47 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-06-05 15:03:22 +00:00
|
|
|
|
|
|
|
- name: Checkout linusg/libjs-test262
|
2022-11-03 06:01:47 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-06-05 15:03:22 +00:00
|
|
|
with:
|
|
|
|
repository: linusg/libjs-test262
|
|
|
|
path: libjs-test262
|
|
|
|
|
|
|
|
- name: Checkout linusg/libjs-website
|
2022-11-03 06:01:47 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-06-05 15:03:22 +00:00
|
|
|
with:
|
|
|
|
repository: linusg/libjs-website
|
|
|
|
path: libjs-website
|
|
|
|
|
|
|
|
- name: Checkout tc39/test262
|
2022-11-03 06:01:47 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-06-05 15:03:22 +00:00
|
|
|
with:
|
|
|
|
repository: tc39/test262
|
|
|
|
path: test262
|
|
|
|
|
|
|
|
- name: Checkout tc39/test262-parser-tests
|
2022-11-03 06:01:47 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-06-05 15:03:22 +00:00
|
|
|
with:
|
|
|
|
repository: tc39/test262-parser-tests
|
|
|
|
path: test262-parser-tests
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-10-31 20:03:29 +00:00
|
|
|
sudo apt-get install -y ninja-build unzip gcc-12 g++-12 jq wget
|
2022-03-17 15:14:03 +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
|
2022-03-17 19:40:18 +00:00
|
|
|
sudo tar xf wabt-1.0.27-ubuntu.tar.gz -C /opt
|
|
|
|
rm wabt-1.0.27-ubuntu.tar.gz
|
2022-03-17 15:14:03 +00:00
|
|
|
)
|
2021-06-05 15:03:22 +00:00
|
|
|
|
|
|
|
- name: Setup Python
|
2022-11-03 06:03:40 +00:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
2021-06-05 15:03:22 +00:00
|
|
|
|
|
|
|
- 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
|
2022-10-31 20:03:29 +00:00
|
|
|
run: set +e; g++ --version; g++-12 --version; python --version; python3 --version; ninja --version
|
2021-06-05 15:03:22 +00:00
|
|
|
|
2021-08-07 12:40:22 +00:00
|
|
|
- name: Create build directory
|
2021-06-05 15:03:22 +00:00
|
|
|
run: |
|
2021-12-22 21:43:05 +00:00
|
|
|
mkdir -p libjs-test262/Build/TZDB
|
2021-08-07 14:28:07 +00:00
|
|
|
mkdir -p libjs-test262/Build/UCD
|
2021-10-21 15:22:32 +00:00
|
|
|
mkdir -p libjs-test262/Build/CLDR
|
2021-08-07 12:40:22 +00:00
|
|
|
|
2021-12-22 21:43:05 +00:00
|
|
|
- name: TimeZoneData cache
|
|
|
|
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
|
|
|
|
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/libjs-test262/Build/TZDB
|
|
|
|
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
|
|
|
|
|
2021-08-07 12:40:22 +00:00
|
|
|
- name: UnicodeData cache
|
|
|
|
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
|
|
|
|
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
|
|
|
|
with:
|
2021-08-07 14:28:07 +00:00
|
|
|
path: ${{ github.workspace }}/libjs-test262/Build/UCD
|
2021-08-08 06:06:55 +00:00
|
|
|
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
|
2021-10-21 15:22:32 +00:00
|
|
|
|
|
|
|
- name: UnicodeLocale cache
|
|
|
|
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
|
|
|
|
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/libjs-test262/Build/CLDR
|
2022-12-21 13:06:37 +00:00
|
|
|
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}
|
2021-08-07 12:40:22 +00:00
|
|
|
|
2022-09-11 13:56:25 +00:00
|
|
|
- name: Build test262-runner, test-js and test-wasm
|
2021-06-05 15:03:22 +00:00
|
|
|
working-directory: libjs-test262
|
|
|
|
run: |
|
|
|
|
cd Build
|
2022-03-17 15:14:03 +00:00
|
|
|
env PATH="/opt/wabt-1.0.27/bin:$PATH" \
|
2022-10-31 20:03:29 +00:00
|
|
|
cmake -GNinja -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DWASM_SPEC_TEST_SKIP_FORMATTING=ON -DINCLUDE_WASM_SPEC_TESTS=ON -DSERENITY_SOURCE_DIR=${{ env.SERENITY_SOURCE_DIR }} ..
|
2022-09-11 13:56:25 +00:00
|
|
|
ninja test262-runner test-js test-wasm
|
2021-06-05 15:03:22 +00:00
|
|
|
|
2021-12-29 14:57:26 +00:00
|
|
|
- name: Get previous results
|
|
|
|
working-directory: libjs-test262
|
|
|
|
run: |
|
2022-01-08 13:19:09 +00:00
|
|
|
cp -f ../libjs-website/test262/data/per-file-master.json .
|
|
|
|
cp -f ../libjs-website/test262/data/per-file-bytecode-master.json .
|
2022-12-03 15:53:23 +00:00
|
|
|
cp -f ../libjs-website/test262/data/per-file-bytecode-optimized-master.json .
|
2022-03-11 07:09:00 +00:00
|
|
|
cp -f ../libjs-website/wasm/data/per-file-master.json wasm-per-file-master.json
|
2021-12-29 14:57:26 +00:00
|
|
|
|
2021-06-05 15:03:22 +00:00
|
|
|
- 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 \
|
2021-12-29 14:57:26 +00:00
|
|
|
--results-json ../libjs-website/test262/data/results.json \
|
|
|
|
--per-file-output ../libjs-website/test262/data/per-file-master.json \
|
2022-12-03 15:53:23 +00:00
|
|
|
--per-file-bytecode-output ../libjs-website/test262/data/per-file-bytecode-master.json \
|
|
|
|
--per-file-bytecode-optimized-output ../libjs-website/test262/data/per-file-bytecode-optimized-master.json
|
2021-06-05 15:03:22 +00:00
|
|
|
|
2022-03-11 07:09:00 +00:00
|
|
|
- name: Run test-wasm
|
|
|
|
working-directory: libjs-test262/Build
|
|
|
|
run: |
|
2022-03-17 19:50:06 +00:00
|
|
|
_deps/lagom-build/test-wasm --per-file > ../../libjs-website/wasm/data/per-file-master.json || true
|
2022-03-16 18:04:43 +00:00
|
|
|
jq -nc -f /dev/stdin <<-EOF --slurpfile previous ../../libjs-website/wasm/data/results.json --slurpfile details ../../libjs-website/wasm/data/per-file-master.json > wasm-new-results.json
|
2022-03-11 07:09:00 +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
|
2022-03-16 18:04:43 +00:00
|
|
|
mv wasm-new-results.json ../../libjs-website/wasm/data/results.json
|
2022-03-11 07:09:00 +00:00
|
|
|
|
2021-06-05 15:03:22 +00:00
|
|
|
- name: Deploy to GitHub pages
|
2022-11-25 22:43:39 +00:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
2021-06-05 15:03:22 +00:00
|
|
|
with:
|
|
|
|
git-config-name: BuggieBot
|
|
|
|
git-config-email: buggiebot@serenityos.org
|
|
|
|
branch: main
|
|
|
|
repository-name: linusg/libjs-website
|
2023-01-06 17:19:42 +00:00
|
|
|
token: ${{ secrets.BUGGIEBOT_TOKEN }}
|
2021-06-05 15:03:22 +00:00
|
|
|
folder: libjs-website
|
2021-12-29 14:57:26 +00:00
|
|
|
|
|
|
|
- name: Compare non-bytecode
|
|
|
|
continue-on-error: true
|
|
|
|
working-directory: libjs-test262
|
2022-01-08 13:19:09 +00:00
|
|
|
run: ./per_file_result_diff.py -o per-file-master.json -n ../libjs-website/test262/data/per-file-master.json
|
2021-12-29 14:57:26 +00:00
|
|
|
|
|
|
|
- name: Compare bytecode
|
|
|
|
continue-on-error: true
|
|
|
|
working-directory: libjs-test262
|
2022-01-08 13:19:09 +00:00
|
|
|
run: ./per_file_result_diff.py -o per-file-bytecode-master.json -n ../libjs-website/test262/data/per-file-bytecode-master.json
|
2022-02-07 15:52:49 +00:00
|
|
|
|
2022-12-03 15:53:23 +00:00
|
|
|
- name: Compare optimized bytecode
|
|
|
|
continue-on-error: true
|
|
|
|
working-directory: libjs-test262
|
|
|
|
run: ./per_file_result_diff.py -o per-file-bytecode-optimized-master.json -n ../libjs-website/test262/data/per-file-bytecode-optimized-master.json
|
|
|
|
|
2022-03-11 07:09:00 +00:00
|
|
|
- name: Compare wasm
|
|
|
|
continue-on-error: true
|
|
|
|
working-directory: libjs-test262
|
|
|
|
run: ./per_file_result_diff.py -o wasm-per-file-master.json -n ../libjs-website/wasm/data/per-file-master.json
|