Skip to content

Commit

Permalink
Build/Test Tools: Remove repository specific logic from callable work…
Browse files Browse the repository at this point in the history
…flows.

Because reusable workflows could be called from any other repository in a variety of contexts, repository specific `if` conditions should not be present.

Instead, this logic should be included in the calling workflows only.

Props johnbillion.
See #62221.

git-svn-id: https://develop.svn.wordpress.org/trunk@59507 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Dec 13, 2024
1 parent e2b0bfd commit b4969d4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk
permissions:
contents: read
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }}
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }}
if: ${{ ! contains( github.event.before, '00000000' ) }}

steps:
- name: Configure environment variables
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ jobs:
run: git diff --exit-code

- name: Checkout the WordPress Test Reporter
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report }}
if: ${{ github.ref == 'refs/heads/trunk' && inputs.report }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: 'WordPress/phpunit-test-runner'
path: 'test-runner'
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Submit test results to the WordPress.org host test results
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report }}
if: ${{ github.ref == 'refs/heads/trunk' && inputs.report }}
env:
WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}"
run: docker compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
3 changes: 0 additions & 3 deletions .github/workflows/reusable-support-json-reader-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
major-wp-version:
name: Determine major WordPress version
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
timeout-minutes: 5
outputs:
version: ${{ steps.major-wp-version.outputs.version }}
Expand Down Expand Up @@ -69,7 +68,6 @@ jobs:
php-versions:
name: Determine PHP versions
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
needs: [ major-wp-version ]
timeout-minutes: 5
outputs:
Expand Down Expand Up @@ -102,7 +100,6 @@ jobs:
mysql-versions:
name: Determine MySQL versions
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
needs: [ major-wp-version ]
timeout-minutes: 5
outputs:
Expand Down

0 comments on commit b4969d4

Please sign in to comment.