Migrate test generation workflow to GitHub Actions

This runs faster and allows for future improvements.

Similar to the linter workflow, we remove the Circle-CI-specific stuff
from the file in tools/scripts/, and into .github/workflows/.

We use another external action (tj-actions/verify-changed-files) to check
that generating the tests didn't create any new changes. This is basically
a companion action to the tj-actions/changed-files used in the linter job.
This commit is contained in:
Philip Chimento 2024-11-04 17:38:34 -08:00 committed by Philip Chimento
parent 15b7a780b3
commit c73968aaaf
4 changed files with 68 additions and 33 deletions

View File

@ -37,21 +37,6 @@ execution_steps: &execution_steps
- run: hostPath=$HOME/.esvu/bin/$hostPath npm run ci
jobs:
"Test262: verify tools; build tests":
docker:
- image: cimg/python:3.7.4
working_directory: ~/test262
steps:
- checkout
- run:
name: "Install requirements for generation tool"
command: python -m pip install --user --requirement tools/generation/requirements.txt
- run:
name: "Test the generation tool"
command: ./tools/generation/test/run.py
- run:
name: "Build tests; check for new changes"
command: ./tools/scripts/ci_build.sh
"V8: New or modified tests execution":
docker:
- image: *node_image
@ -123,9 +108,6 @@ jobs:
<<: [*execution_steps]
workflows:
version: 2
Tools:
jobs:
- "Test262: verify tools; build tests"
Tests execution:
jobs:
# - "ChakraCore: New or modified tests execution"

View File

@ -26,3 +26,36 @@ jobs:
- name: Lint all tests
run: ./tools/lint/lint.py test/
build:
name: Build generated tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
- name: Install dependencies for generation tool
run: |
python -m pip install --upgrade pip
pip install -r tools/generation/requirements.txt
- name: Test the generation tool
run: ./tools/generation/test/run.py
- name: Build tests
run: ./tools/scripts/ci_build.sh
- name: Verify changes
uses: tj-actions/verify-changed-files@v20
with:
fail-if-changed: true
fail-message: |
New changes were found after re-generating the tests.
Please read the documentation on procedurally generated tests
https://github.com/tc39/test262/blob/HEAD/CONTRIBUTING.md#procedurally-generated-tests

View File

@ -46,3 +46,37 @@ jobs:
run: |
awk -F': ' <errors.out \
"{ sub(\"$(pwd)/\", \"\"); printf \"::error file=%s,line=1::%s\n\", \$1, \$2 }"
build:
name: Build generated tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
- name: Install dependencies for generation tool
run: |
python -m pip install --upgrade pip
pip install -r tools/generation/requirements.txt
- name: Test the generation tool
run: ./tools/generation/test/run.py
- name: Build tests
run: ./tools/scripts/ci_build.sh
- name: Verify changes
uses: tj-actions/verify-changed-files@v20
with:
fail-if-changed: true
fail-message: |
New changes were found after re-generating the tests.
Please read the documentation on procedurally generated tests
https://github.com/tc39/test262/blob/HEAD/CONTRIBUTING.md#procedurally-generated-tests

View File

@ -1,17 +1,3 @@
#!/bin/sh
if [ "$CIRCLE_PULL_REQUEST" != "" ]; then
./make.py clean > /dev/null
fi
./make.py clean > /dev/null
./make.py
if [ -n "$(git status --porcelain)" -a "$CIRCLE_PULL_REQUEST" != "" ]; then
echo New changes were found after re-generating the tests.
echo ""
git status --porcelain;
echo ""
git diff;
echo ""
echo Please, read the documentation on procedurally generated tests
echo 'https://github.com/tc39/test262/blob/HEAD/CONTRIBUTING.md#procedurally-generated-tests'
exit 1
fi