Migrate staging tests for JSON-parse-with-source #1698
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'esmeta test262' | |
on: [pull_request] | |
jobs: | |
esmeta-test262: | |
name: 'esmeta test262' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup SBT | |
uses: sbt/setup-sbt@v1 | |
if: ${{ hashFiles('/usr/bin/sbt') == '' }} | |
# https://www.peterbe.com/plog/how-to-run-workflow-step-if-a-file-exists | |
- name: Add to PATH | |
shell: bash | |
run: | | |
echo "ESMETA_HOME=$(pwd)/vendor/esmeta" >> $GITHUB_ENV | |
- name: download esmeta | |
run: | | |
mkdir -p "${ESMETA_HOME}" | |
git clone --branch v0.4.2 --depth 1 https://github.com/es-meta/esmeta.git "${ESMETA_HOME}" | |
cd "${ESMETA_HOME}" && git submodule update --init --depth 1 | |
- name: build esmeta | |
working-directory: ${{ env.ESMETA_HOME }} | |
run: sbt assembly | |
- name: run test262 | |
run: | | |
git fetch origin main | |
paths=$(git diff --diff-filter ACMR --name-only origin/main.. -- test/) | |
if [ "$paths" == "" ]; then | |
echo No test files added or modified. Exiting. | |
exit 0 | |
fi | |
echo New or modified test files: | |
echo "$paths" | |
"${ESMETA_HOME}"/bin/esmeta test262-test -status -test262dir=$(pwd) $paths |