From 5be20253698d65f50da1e94d0c9cea0d745505d9 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 4 Nov 2024 17:58:28 -0800 Subject: [PATCH] Use changed-files action in ESMeta job as well Since we are using it in the other jobs, we may as well use it here. As a bonus, it will make the job work even if the target of the pull request isn't the main branch. --- .github/workflows/esmeta-test262.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/esmeta-test262.yml b/.github/workflows/esmeta-test262.yml index 5959370879..1404303266 100644 --- a/.github/workflows/esmeta-test262.yml +++ b/.github/workflows/esmeta-test262.yml @@ -30,14 +30,20 @@ jobs: - name: build esmeta working-directory: ${{ env.ESMETA_HOME }} run: sbt assembly + + - name: Identify new or changed tests + id: changed_tests + uses: tj-actions/changed-files@v45 + with: + files: test/ + - name: run test262 + if: steps.changed_tests.outputs.any_changed == 'true' + env: + CHANGED: ${{ steps.changed_tests.outputs.all_changed_files }} 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 + for file in $CHANGED; do + echo $file + done + "${ESMETA_HOME}"/bin/esmeta test262-test -status -test262dir=$(pwd) $CHANGED