From e5545f59e69561a2518b2d8fdb064656632c87ad Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 7 May 2024 09:13:16 -0400 Subject: [PATCH 1/9] Make workflows callable. --- .github/workflows/coding-standards.yml | 125 ++---------- .github/workflows/end-to-end-tests.yml | 105 ++-------- .github/workflows/javascript-tests.yml | 48 ++--- .github/workflows/php-compatibility.yml | 76 ++------ .github/workflows/phpunit-tests.yml | 217 +++++---------------- .github/workflows/test-build-processes.yml | 129 ++++++++++++ .github/workflows/test-npm.yml | 208 -------------------- 7 files changed, 231 insertions(+), 677 deletions(-) create mode 100644 .github/workflows/test-build-processes.yml delete mode 100644 .github/workflows/test-npm.yml diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index d8073626197aa..095c2f8352399 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -40,128 +40,35 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} cancel-in-progress: true +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + jobs: # Runs PHP coding standards checks. - # - # Violations are reported inline with annotations. - # - # Performs the following steps: - # - Checks out the repository. - # - Sets up PHP. - # - Configures caching for PHPCS scans. - # - Installs Composer dependencies. - # - Make Composer packages available globally. - # - Runs PHPCS on the full codebase with warnings suppressed. - # - Generate a report for displaying issues as pull request annotations. - # - Runs PHPCS on the `tests` directory without warnings suppressed. - # - Generate a report for displaying `test` directory issues as pull request annotations. - # - Ensures version-controlled files are not modified or deleted. phpcs: name: PHP coding standards - runs-on: ubuntu-latest - timeout-minutes: 20 + uses: desrosj/wordpress-develop/.github/workflows/callable-coding-standards-php.yml@try/make-workflows-callable + permissions: + contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - - steps: - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up PHP - uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 - with: - php-version: '7.4' - coverage: none - tools: cs2pr - - # This date is used to ensure that the PHPCS cache is cleared at least once every week. - # http://man7.org/linux/man-pages/man1/date.1.html - - name: "Get last Monday's date" - id: get-date - run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT - - - name: Cache PHPCS scan cache - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 - with: - path: .cache/phpcs.json - key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} - - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 - with: - custom-cache-suffix: ${{ steps.get-date.outputs.date }} - - - name: Make Composer packages available globally - run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH - - - name: Run PHPCS on all Core files - id: phpcs-core - run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml - - - name: Show PHPCS results in PR - if: ${{ always() && steps.phpcs-core.outcome == 'failure' }} - run: cs2pr ./.cache/phpcs-report.xml - - - name: Check test suite files for warnings - id: phpcs-tests - run: phpcs tests --report-full --report-checkstyle=./.cache/phpcs-tests-report.xml - - - name: Show test suite scan results in PR - if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }} - run: cs2pr ./.cache/phpcs-tests-report.xml - - - name: Ensure version-controlled files are not modified during the tests - run: git diff --exit-code + with: + php-version: '7.4' # Runs the JavaScript coding standards checks. - # - # JSHint violations are not currently reported inline with annotations. - # - # Performs the following steps: - # - Checks out the repository. - # - Sets up Node.js. - # - Logs debug information about the GitHub Action runner. - # - Installs npm dependencies. - # - Run the WordPress JSHint checks. - # - Ensures version-controlled files are not modified or deleted. jshint: name: JavaScript coding standards - runs-on: ubuntu-latest - timeout-minutes: 20 + uses: desrosj/wordpress-develop/.github/workflows/callable-coding-standards-javascript.yml@try/make-workflows-callable + permissions: + contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - env: - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} - - steps: - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Log debug information - run: | - npm --version - node --version - git --version - svn --version - - - name: Install npm Dependencies - run: npm ci - - - name: Run JSHint - run: npm run grunt jshint - - - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code slack-notifications: name: Slack Notifications uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + permissions: + actions: read + contents: read needs: [ phpcs, jshint ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: @@ -175,6 +82,8 @@ jobs: failed-workflow: name: Failed workflow tasks runs-on: ubuntu-latest + permissions: + actions: write needs: [ phpcs, jshint, slack-notifications ] if: | always() && diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index b7f3db0b57740..2fc1424640028 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -26,105 +26,35 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} cancel-in-progress: true +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + env: LOCAL_DIR: build - LOCAL_PHP: 8.0-fpm jobs: # Runs the end-to-end test suite. - # - # Performs the following steps: - # - Sets environment variables. - # - Checks out the repository. - # - Sets up Node.js. - # - Logs debug information about the GitHub Action runner. - # - Installs npm dependencies. - # - Builds WordPress to run from the `build` directory. - # - Starts the WordPress Docker container. - # - Logs the running Docker containers. - # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container). - # - Install WordPress within the Docker container. - # - Run the E2E tests. - # - Ensures version-controlled files are not modified or deleted. e2e-tests: - name: E2E Tests - runs-on: ubuntu-latest - timeout-minutes: 20 + name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }} + uses: desrosj/wordpress-develop/.github/workflows/callable-end-to-end-tests.yml@try/make-workflows-callable + permissions: + contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - - steps: - - name: Configure environment variables - run: | - echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV - echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV - - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Log debug information - run: | - npm --version - node --version - curl --version - git --version - svn --version - locale -a - - - name: Install npm Dependencies - run: npm ci - - - name: Build WordPress - run: npm run build - - - name: Start Docker environment - run: | - npm run env:start - - - name: Log running Docker containers - run: docker ps -a - - - name: Docker debug information - run: | - docker -v - docker-compose -v - docker-compose run --rm mysql mysql --version - docker-compose run --rm php php --version - docker-compose run --rm php php -m - docker-compose run --rm php php -i - docker-compose run --rm php locale -a - - - name: Install WordPress - run: npm run env:install - - - name: Run E2E tests - run: npm run test:e2e - - - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - needs: [ e2e-tests ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} + strategy: + fail-fast: false + matrix: + LOCAL_SCRIPT_DEBUG: [ true, false ] with: - calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} + LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }} + install-gutenberg: false failed-workflow: name: Failed workflow tasks runs-on: ubuntu-latest - needs: [ e2e-tests, slack-notifications ] + permissions: + actions: write + needs: [ e2e-tests ] if: | always() && github.repository == 'WordPress/wordpress-develop' && @@ -133,7 +63,6 @@ jobs: ( needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure' ) - steps: - name: Dispatch workflow run uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 8c48cdef495c4..6cb24f8244e0f 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -38,51 +38,25 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} cancel-in-progress: true +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + jobs: # Runs the QUnit tests for WordPress. - # - # Performs the following steps: - # - Checks out the repository. - # - Sets up Node.js. - # - Logs debug information about the GitHub Action runner. - # - Installs npm dependencies. - # - Run the WordPress QUnit tests. - # - Ensures version-controlled files are not modified or deleted. test-js: name: QUnit Tests - runs-on: ubuntu-latest - timeout-minutes: 20 + uses: desrosj/wordpress-develop/.github/workflows/callable-javascript-tests.yml@try/make-workflows-callable + permissions: + contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - steps: - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Log debug information - run: | - npm --version - node --version - git --version - svn --version - - - name: Install npm Dependencies - run: npm ci - - - name: Run QUnit tests - run: npm run grunt qunit:compiled - - - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code - slack-notifications: name: Slack Notifications uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + permissions: + actions: read + contents: read needs: [ test-js ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: @@ -96,6 +70,8 @@ jobs: failed-workflow: name: Failed workflow tasks runs-on: ubuntu-latest + permissions: + actions: write needs: [ test-js, slack-notifications ] if: | always() && diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 4bcec47a1d6f3..398bc5deb99dc 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -35,79 +35,25 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} cancel-in-progress: true -jobs: +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} +jobs: # Runs PHP compatibility testing. - # - # Violations are reported inline with annotations. - # - # Performs the following steps: - # - Checks out the repository. - # - Sets up PHP. - # - Logs debug information. - # - Configures caching for PHP compatibility scans. - # - Installs Composer dependencies. - # - Make Composer packages available globally. - # - Runs the PHP compatibility tests. - # - Generate a report for displaying issues as pull request annotations. - # - Ensures version-controlled files are not modified or deleted. php-compatibility: name: Check PHP compatibility - runs-on: ubuntu-latest - timeout-minutes: 20 + uses: desrosj/wordpress-develop/.github/workflows/callable-php-compatibility.yml@try/make-workflows-callable + permissions: + contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - steps: - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up PHP - uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 - with: - php-version: '7.4' - coverage: none - tools: cs2pr - - - name: Log debug information - run: | - composer --version - - # This date is used to ensure that the PHP compatibility cache is cleared at least once every week. - # http://man7.org/linux/man-pages/man1/date.1.html - - name: "Get last Monday's date" - id: get-date - run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT - - - name: Cache PHP compatibility scan cache - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 - with: - path: .cache/phpcompat.json - key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} - - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 - with: - custom-cache-suffix: ${{ steps.get-date.outputs.date }} - - - name: Make Composer packages available globally - run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH - - - name: Run PHP compatibility tests - id: phpcs - run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml - - - name: Show PHPCompatibility results in PR - if: ${{ always() && steps.phpcs.outcome == 'failure' }} - run: cs2pr ./.cache/phpcs-compat-report.xml - - - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code - slack-notifications: name: Slack Notifications uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + permissions: + actions: read + contents: read needs: [ php-compatibility ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: @@ -121,6 +67,8 @@ jobs: failed-workflow: name: Failed workflow tasks runs-on: ubuntu-latest + permissions: + actions: write needs: [ php-compatibility, slack-notifications ] if: | always() && diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 95c9a695513aa..b9eafbf7794d6 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -26,201 +26,70 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} cancel-in-progress: true -env: - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} - LOCAL_PHP_MEMCACHED: ${{ false }} - SLOW_TESTS: 'external-http,media,restapi' +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + jobs: - # Runs the PHPUnit tests for WordPress. # - # Performs the following steps: - # - Sets environment variables. - # - Checks out the repository. - # - Sets up Node.js. - # - Sets up PHP. - # - Installs Composer dependencies. - # - Installs npm dependencies - # - Logs general debug information about the runner. - # - Logs Docker debug information (about the Docker installation within the runner). - # - Starts the WordPress Docker container. - # - Logs the running Docker containers. - # - Logs debug information about what's installed within the WordPress Docker containers. - # - Install WordPress within the Docker container. - # - Run the PHPUnit tests. - # - Ensures version-controlled files are not modified or deleted. - # - Checks out the WordPress Test reporter repository. - # - Submit the test results to the WordPress.org host test results. + # Creates a PHPUnit test job for each PHP/MySQL combination. + # test-php: - name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - timeout-minutes: 20 + name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} + uses: desrosj/wordpress-develop/.github/workflows/callable-phpunit-tests.yml@try/make-workflows-callable + permissions: + contents: read + secrets: inherit if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} strategy: fail-fast: false matrix: - php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] os: [ ubuntu-latest ] - memcached: [ false ] - split_slow: [ false ] + php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] + db-type: [ 'mysql' ] + db-version: [ '5.7' ] multisite: [ false, true ] + memcached: [ false ] + include: - # Additional "slow" jobs for PHP 5.6. - - php: '5.6' - os: ubuntu-latest - memcached: false - multisite: false - split_slow: true - - php: '5.6' - os: ubuntu-latest - memcached: false - multisite: true - split_slow: true # Include jobs for PHP 7.4 with memcached. - - php: '7.4' - os: ubuntu-latest - memcached: true + - os: ubuntu-latest + php: '7.4' + db-type: 'mysql' + db-version: '5.7' multisite: false - - php: '7.4' - os: ubuntu-latest memcached: true + - os: ubuntu-latest + php: '7.4' + db-type: 'mysql' + db-version: '5.7' multisite: true + memcached: true # Report the results of the PHP 7.4 without memcached job. - - php: '7.4' - os: ubuntu-latest - memcached: false + - os: ubuntu-latest + php: '7.4' + db-type: 'mysql' + db-version: '5.7' multisite: false + memcached: false report: true - - env: - LOCAL_PHP: ${{ matrix.php }}-fpm - LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }} - PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} - - steps: - - name: Configure environment variables - run: | - echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV - echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV - - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version-file: '.nvmrc' - cache: npm - - ## - # This allows Composer dependencies to be installed using a single step. - # - # Since the tests are currently run within the Docker containers where the PHP version varies, - # the same PHP version needs to be configured for the action runner machine so that the correct - # dependency versions are installed and cached. - ## - - name: Set up PHP - uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 - with: - php-version: '${{ matrix.php }}' - coverage: none - - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 - with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - - - name: Install npm dependencies - run: npm ci - - - name: General debug information - run: | - npm --version - node --version - curl --version - git --version - svn --version - composer --version - locale -a - - - name: Docker debug information - run: | - docker -v - docker-compose -v - - - name: Start Docker environment - run: | - npm run env:start - - - name: Log running Docker containers - run: docker ps -a - - - name: WordPress Docker container debug information - run: | - docker-compose run --rm mysql mysql --version - docker-compose run --rm php php --version - docker-compose run --rm php php -m - docker-compose run --rm php php -i - docker-compose run --rm php locale -a - - - name: Install WordPress - run: npm run env:install - - - name: Run slow PHPUnit tests - if: ${{ matrix.split_slow }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }} - - - name: Run PHPUnit tests for single site excluding slow tests - if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required - - - name: Run PHPUnit tests for Multisite excluding slow tests - if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers - - - name: Run PHPUnit tests - if: ${{ matrix.php >= '7.0' }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} - - - name: Run AJAX tests - if: ${{ ! matrix.split_slow }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax - - - name: Run ms-files tests as a multisite install - if: ${{ matrix.multisite && ! matrix.split_slow }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files - - - name: Run external HTTP tests - if: ${{ ! matrix.multisite && ! matrix.split_slow }} - run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http - - # __fakegroup__ is excluded to force PHPUnit to ignore the settings in phpunit.xml.dist. - # This test group is not (yet) run against PHP 8.2 as there is no stable Xdebug version available yet for PHP 8.2. - - name: Run (Xdebug) tests - if: ${{ ! matrix.split_slow && matrix.php != '8.2' }} - run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ - - - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code - - - name: Checkout the WordPress Test Reporter - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - with: - repository: 'WordPress/phpunit-test-runner' - path: 'test-runner' - - - name: Submit test results to the WordPress.org host test results - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.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 + with: + os: ${{ matrix.os }} + php: ${{ matrix.php }} + db-type: ${{ matrix.db-type }} + db-version: ${{ matrix.db-version }} + multisite: ${{ matrix.multisite }} + memcached: ${{ matrix.memcached }} + phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} + report: ${{ matrix.report || false }} slack-notifications: name: Slack Notifications uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + permissions: + actions: read + contents: read needs: [ test-php ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: @@ -234,6 +103,8 @@ jobs: failed-workflow: name: Failed workflow tasks runs-on: ubuntu-latest + permissions: + actions: write needs: [ test-php, slack-notifications ] if: | always() && diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml new file mode 100644 index 0000000000000..6d89d38cdea8a --- /dev/null +++ b/.github/workflows/test-build-processes.yml @@ -0,0 +1,129 @@ +name: Test Build Processes + +on: + push: + branches: + - trunk + - '3.[7-9]' + - '[4-9].[0-9]' + tags: + - '[0-9]+.[0-9]' + - '[0-9]+.[0-9].[0-9]+' + pull_request: + branches: + - trunk + - '3.[7-9]' + - '[4-9].[0-9]' + paths: + # These files configure npm. Changes could affect the outcome. + - 'package*.json' + # JavaScript files are built using npm. + - '**.js' + # CSS and SCSS files are built using npm. + - '**.scss' + - '**.css' + # Changes to workflow files should always verify all workflows are successful. + - '.github/workflows/**.yml' + workflow_dispatch: + +# Cancels all previous workflow runs for pull requests that have not completed. +concurrency: + # The concurrency group contains the workflow name and the branch name for pull requests + # or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + +jobs: + # Tests the WordPress Core build process on multiple operating systems. + test-core-build-process: + name: Core running from ${{ matrix.directory }} + uses: desrosj/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@try/make-workflows-callable + permissions: + contents: read + if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, windows-latest ] + directory: [ 'src', 'build' ] + with: + os: ${{ matrix.os }} + directory: ${{ matrix.directory }} + test-emoji: false + + # Tests the WordPress Core build process on MacOS. + # + # This is separate from the job above in order to use stricter conditions when determining when to run. + # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. + # + # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is + # currently no way to determine the OS being used on a given job. + # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. + test-core-build-process-macos: + name: Core running from ${{ matrix.directory }} + uses: desrosj/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@try/make-workflows-callable + permissions: + contents: read + if: ${{ github.repository == 'WordPress/wordpress-develop' }} + strategy: + fail-fast: false + matrix: + os: [ macos-13 ] + directory: [ 'src', 'build' ] + with: + os: ${{ matrix.os }} + directory: ${{ matrix.directory }} + test-emoji: false + + slack-notifications: + name: Slack Notifications + uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + permissions: + actions: read + contents: read + needs: [ test-core-build-process, test-core-build-process-macos ] + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} + with: + calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} + secrets: + SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} + SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} + SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} + SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} + + failed-workflow: + name: Failed workflow tasks + runs-on: ubuntu-latest + permissions: + actions: write + needs: [ slack-notifications ] + if: | + always() && + github.repository == 'WordPress/wordpress-develop' && + github.event_name != 'pull_request' && + github.run_attempt < 2 && + ( + contains( needs.*.result, 'cancelled' ) || + contains( needs.*.result, 'failure' ) + ) + + steps: + - name: Dispatch workflow run + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + with: + retries: 2 + retry-exempt-status-codes: 418 + script: | + github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'failed-workflow.yml', + ref: 'trunk', + inputs: { + run_id: '${{ github.run_id }}' + } + }); diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml deleted file mode 100644 index 512984d71bebe..0000000000000 --- a/.github/workflows/test-npm.yml +++ /dev/null @@ -1,208 +0,0 @@ -name: Test npm - -on: - push: - branches: - - trunk - - '3.[7-9]' - - '[4-9].[0-9]' - tags: - - '[0-9]+.[0-9]' - - '[0-9]+.[0-9].[0-9]+' - pull_request: - branches: - - trunk - - '3.[7-9]' - - '[4-9].[0-9]' - paths: - # These files configure npm. Changes could affect the outcome. - - 'package*.json' - # JavaScript files are built using npm. - - '**.js' - # CSS and SCSS files are built using npm. - - '**.scss' - - '**.css' - # Changes to workflow files should always verify all workflows are successful. - - '.github/workflows/**.yml' - workflow_dispatch: - -# Cancels all previous workflow runs for pull requests that have not completed. -concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests - # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -env: - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} - -jobs: - # Verifies that installing npm dependencies and building WordPress works as expected. - # - # Performs the following steps: - # - Checks out the repository. - # - Sets up Node.js. - # - Logs debug information about the GitHub Action runner. - # - Installs npm dependencies. - # - Builds WordPress to run from the `build` directory. - # - Cleans up after building WordPress to the `build` directory. - # - Ensures version-controlled files are not modified or deleted. - # - Builds WordPress to run from the `src` directory. - # - Cleans up after building WordPress to the `src` directory. - # - Ensures version-controlled files are not modified or deleted. - test-npm: - name: Test npm on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, windows-latest ] - - steps: - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Log debug information - run: | - npm --version - node --version - curl --version - git --version - svn --version - - - name: Install npm Dependencies - run: npm ci - - - name: Build WordPress in /src - run: npm run build:dev - - - name: Clean after building in /src - run: npm run grunt clean -- --dev - - - name: Ensure version-controlled files are not modified or deleted during building and cleaning - run: git diff --exit-code - - - name: Build WordPress - run: npm run build - - - name: Clean after building - run: npm run grunt clean - - - name: Ensure version-controlled files are not modified or deleted during building and cleaning - run: git diff --exit-code - - # Verifies that installing npm dependencies and building WordPress works as expected on MacOS. - # - # This is separate from the job above in order to use stricter conditions about when to run. - # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. - # - # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is - # currently no way to determine the OS being used on a given job. - # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. - # - # Performs the following steps: - # - Checks out the repository. - # - Sets up Node.js. - # - Logs debug information about the GitHub Action runner. - # - Installs npm dependencies. - # - Builds WordPress to run from the `build` directory. - # - Cleans up after building WordPress to the `build` directory. - # - Ensures version-controlled files are not modified or deleted. - # - Builds WordPress to run from the `src` directory. - # - Cleans up after building WordPress to the `src` directory. - # - Ensures version-controlled files are not modified or deleted. - test-npm-macos: - name: Test npm on MacOS - runs-on: macos-latest - timeout-minutes: 30 - if: ${{ github.repository == 'WordPress/wordpress-develop' }} - steps: - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Log debug information - run: | - npm --version - node --version - curl --version - git --version - svn --version - - - name: Install npm Dependencies - run: npm ci - - - name: Build WordPress in /src - run: npm run build:dev - - - name: Clean after building in /src - run: npm run grunt clean -- --dev - - - name: Ensure version-controlled files are not modified or deleted during building and cleaning - run: git diff --exit-code - - - name: Build WordPress - run: npm run build - - - name: Clean after building - run: npm run grunt clean - - - name: Ensure version-controlled files are not modified or deleted during building and cleaning - run: git diff --exit-code - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - needs: [ test-npm, test-npm-macos ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ needs.test-npm.result == 'success' && needs.test-npm-macos.result == 'success' && 'success' || ( needs.test-npm.result == 'cancelled' || needs.test-npm-macos.result == 'cancelled' ) && 'cancelled' || 'failure' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-latest - needs: [ test-npm, test-npm-macos, slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' || - needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure' - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: '${{ github.run_id }}' - } - }); From 33d26894cfd7e4788fb4ceca32f3cab9caec80a7 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 7 May 2024 09:19:02 -0400 Subject: [PATCH 2/9] Re-add PHP 5.6. --- .github/workflows/phpunit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index b9eafbf7794d6..50c718d4d2a67 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -46,7 +46,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] + php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] db-type: [ 'mysql' ] db-version: [ '5.7' ] multisite: [ false, true ] From 747ae28f54dc95ff8fc237026f93f7259f0cdccc Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 15 May 2024 12:57:15 -0400 Subject: [PATCH 3/9] Remove `version` from `docker-compose.yml` --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 739c65f4a8dc5..4595b8d9c060e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.7' - services: ## From aee4a3dfca497b617545d97374d6fe1315e9d4b7 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 15 May 2024 13:41:36 -0400 Subject: [PATCH 4/9] Run compatibility scan on PHP 7.4. --- .github/workflows/php-compatibility.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 398bc5deb99dc..f7c67a88656b0 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -47,6 +47,8 @@ jobs: permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + with: + php-version: '7.4' slack-notifications: name: Slack Notifications From 4825222e0531859ba5423763e204d7cc4e7c3988 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 3 Jun 2024 13:39:40 -0400 Subject: [PATCH 5/9] Fixes for compose configuration. --- docker-compose.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4595b8d9c060e..db179f91b9fa9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,10 @@ services: command: /bin/sh -c "envsubst '$$LOCAL_DIR' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'" depends_on: - - php + php: + condition: service_started + mysql: + condition: service_healthy ## # The PHP container. @@ -50,9 +53,6 @@ services: # Copy or delete the Memcached dropin plugin file as appropriate. command: /bin/sh -c "if [ $LOCAL_PHP_MEMCACHED = true ]; then cp -n /var/www/tests/phpunit/includes/object-cache.php /var/www/src/wp-content/object-cache.php; else rm -f /var/www/src/wp-content/object-cache.php; fi && exec php-fpm" - depends_on: - - mysql - # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly. init: true @@ -63,7 +63,8 @@ services: # The MySQL container. ## mysql: - image: amd64/${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest} + image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest} + platform: linux/amd64 networks: - wpdevnet @@ -81,6 +82,12 @@ services: # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0. command: --default-authentication-plugin=mysql_native_password + healthcheck: + test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then mariadb-admin ping -h localhost; else mysqladmin ping -h localhost; fi" ] + timeout: 5s + interval: 5s + retries: 10 + ## # The WP CLI container. ## @@ -105,6 +112,12 @@ services: extra_hosts: - localhost:host-gateway + depends_on: + php: + condition: service_started + mysql: + condition: service_healthy + ## # The Memcached container. ## @@ -117,6 +130,10 @@ services: ports: - 11211:11211 + depends_on: + php: + condition: service_started + volumes: # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume. mysql: {} From aa7b5ba790e9724236b15a3679013f99160458ea Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 3 Jun 2024 13:41:03 -0400 Subject: [PATCH 6/9] Update Docker compose to v2. --- tools/local-env/scripts/docker.js | 4 ++-- tools/local-env/scripts/install.js | 6 +++--- tools/local-env/scripts/start.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/local-env/scripts/docker.js b/tools/local-env/scripts/docker.js index fed70aeb59612..b33fc2b3ed0e3 100644 --- a/tools/local-env/scripts/docker.js +++ b/tools/local-env/scripts/docker.js @@ -4,5 +4,5 @@ const { execSync } = require( 'child_process' ); dotenvExpand.expand( dotenv.config() ); -// Execute any docker-compose command passed to this script. -execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } ); +// Execute any docker compose command passed to this script. +execSync( 'docker compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } ); diff --git a/tools/local-env/scripts/install.js b/tools/local-env/scripts/install.js index c17bbce887329..5b57b7ebceaa8 100644 --- a/tools/local-env/scripts/install.js +++ b/tools/local-env/scripts/install.js @@ -45,7 +45,7 @@ wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } ) * @param {string} cmd The WP-CLI command to run. */ function wp_cli( cmd ) { - execSync( `docker-compose run --rm cli ${cmd}`, { stdio: 'inherit' } ); + execSync( `docker compose run --rm cli ${cmd}`, { stdio: 'inherit' } ); } /** @@ -54,6 +54,6 @@ function wp_cli( cmd ) { function install_wp_importer() { const testPluginDirectory = 'tests/phpunit/data/plugins/wordpress-importer'; - execSync( `docker-compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } ); - execSync( `docker-compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } ); + execSync( `docker compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } ); + execSync( `docker compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } ); } diff --git a/tools/local-env/scripts/start.js b/tools/local-env/scripts/start.js index 35edf7f96fe5e..e3dd9c6fc1edb 100644 --- a/tools/local-env/scripts/start.js +++ b/tools/local-env/scripts/start.js @@ -8,7 +8,7 @@ dotenvExpand.expand( dotenv.config() ); const containers = ( process.env.LOCAL_PHP_MEMCACHED === 'true' ) ? 'wordpress-develop memcached' : 'wordpress-develop'; -execSync( `docker-compose up -d ${containers}`, { stdio: 'inherit' } ); +execSync( `docker compose up -d ${containers}`, { stdio: 'inherit' } ); // If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM. if ( process.env.DOCKER_TOOLBOX_INSTALL_PATH ) { From b4a63f31c8b5e573b4171e61274c92a26b0d5bee Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 3 Jun 2024 13:42:34 -0400 Subject: [PATCH 7/9] Use the correct workflow naming. --- .github/workflows/coding-standards.yml | 4 ++-- .github/workflows/end-to-end-tests.yml | 2 +- .github/workflows/javascript-tests.yml | 2 +- .github/workflows/php-compatibility.yml | 2 +- .github/workflows/phpunit-tests.yml | 2 +- .github/workflows/test-build-processes.yml | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 095c2f8352399..6b21b48c8238e 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -48,7 +48,7 @@ jobs: # Runs PHP coding standards checks. phpcs: name: PHP coding standards - uses: desrosj/wordpress-develop/.github/workflows/callable-coding-standards-php.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@try/make-workflows-callable permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -58,7 +58,7 @@ jobs: # Runs the JavaScript coding standards checks. jshint: name: JavaScript coding standards - uses: desrosj/wordpress-develop/.github/workflows/callable-coding-standards-javascript.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@try/make-workflows-callable permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 2fc1424640028..3d40841ebb8e9 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -37,7 +37,7 @@ jobs: # Runs the end-to-end test suite. e2e-tests: name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }} - uses: desrosj/wordpress-develop/.github/workflows/callable-end-to-end-tests.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@try/make-workflows-callable permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 6cb24f8244e0f..16810fc190dce 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -46,7 +46,7 @@ jobs: # Runs the QUnit tests for WordPress. test-js: name: QUnit Tests - uses: desrosj/wordpress-develop/.github/workflows/callable-javascript-tests.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@try/make-workflows-callable permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index f7c67a88656b0..67fedfdee17a2 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -43,7 +43,7 @@ jobs: # Runs PHP compatibility testing. php-compatibility: name: Check PHP compatibility - uses: desrosj/wordpress-develop/.github/workflows/callable-php-compatibility.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@try/make-workflows-callable permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 50c718d4d2a67..06e0db82dc9c7 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -37,7 +37,7 @@ jobs: # test-php: name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} - uses: desrosj/wordpress-develop/.github/workflows/callable-phpunit-tests.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests.yml@try/make-workflows-callable permissions: contents: read secrets: inherit diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index 6d89d38cdea8a..d551ed0708647 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -41,7 +41,7 @@ jobs: # Tests the WordPress Core build process on multiple operating systems. test-core-build-process: name: Core running from ${{ matrix.directory }} - uses: desrosj/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@try/make-workflows-callable permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -65,7 +65,7 @@ jobs: # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. test-core-build-process-macos: name: Core running from ${{ matrix.directory }} - uses: desrosj/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@try/make-workflows-callable permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' }} From c3f260681e749b9fc525a04c3d22d4fc92a2a8df Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 3 Jun 2024 13:42:56 -0400 Subject: [PATCH 8/9] Use workflows in trunk. --- .github/workflows/coding-standards.yml | 4 ++-- .github/workflows/end-to-end-tests.yml | 2 +- .github/workflows/javascript-tests.yml | 2 +- .github/workflows/php-compatibility.yml | 2 +- .github/workflows/phpunit-tests.yml | 2 +- .github/workflows/test-build-processes.yml | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 6b21b48c8238e..7effa3838b8c3 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -48,7 +48,7 @@ jobs: # Runs PHP coding standards checks. phpcs: name: PHP coding standards - uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -58,7 +58,7 @@ jobs: # Runs the JavaScript coding standards checks. jshint: name: JavaScript coding standards - uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 3d40841ebb8e9..e9de6f00abf36 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -37,7 +37,7 @@ jobs: # Runs the end-to-end test suite. e2e-tests: name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 16810fc190dce..a881b8e6fa2be 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -46,7 +46,7 @@ jobs: # Runs the QUnit tests for WordPress. test-js: name: QUnit Tests - uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 67fedfdee17a2..0a501e05baa76 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -43,7 +43,7 @@ jobs: # Runs PHP compatibility testing. php-compatibility: name: Check PHP compatibility - uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 06e0db82dc9c7..a7f6af287637f 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -37,7 +37,7 @@ jobs: # test-php: name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests.yml@trunk permissions: contents: read secrets: inherit diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index d551ed0708647..227cf0873873e 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -41,7 +41,7 @@ jobs: # Tests the WordPress Core build process on multiple operating systems. test-core-build-process: name: Core running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} @@ -65,7 +65,7 @@ jobs: # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. test-core-build-process-macos: name: Core running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@try/make-workflows-callable + uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' }} From e019e07eb15900a616d4db3fc8eef1c1c8a286af Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 4 Jun 2024 08:45:55 -0400 Subject: [PATCH 9/9] Use PHP 8.0 for E2E testing. --- .github/workflows/end-to-end-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index e9de6f00abf36..7735b66eab05a 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -47,6 +47,7 @@ jobs: LOCAL_SCRIPT_DEBUG: [ true, false ] with: LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }} + php-version: '8.0' install-gutenberg: false failed-workflow: