Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all workflows callable #6232

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6f55e1b
Use test branch of props bot.
desrosj Feb 15, 2024
553cba9
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Feb 15, 2024
21d3646
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Feb 16, 2024
c786b77
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Feb 20, 2024
7e0d556
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Feb 25, 2024
9b2f7eb
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Feb 26, 2024
a5335d5
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Mar 3, 2024
b926267
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Mar 5, 2024
b60162b
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Mar 5, 2024
5171fbb
Merge remote-tracking branch 'upstream/trunk' into trunk
desrosj Mar 7, 2024
ceac456
Convert the JS test workflow into a callable one.
desrosj Mar 7, 2024
49640a2
Correct branch name,.
desrosj Mar 7, 2024
84e88eb
Fix required job name.
desrosj Mar 7, 2024
4357138
Remove Puppeteer environment variable.
desrosj Mar 7, 2024
ab29263
Make the PHPCS workflow callable.
desrosj Mar 7, 2024
dfaccbd
Make the JavaScript coding standards callable.
desrosj Mar 7, 2024
4e90351
Merge remote-tracking branch 'upstream/trunk' into try/make-workflows…
desrosj Apr 4, 2024
555d601
Revert back to using `trunk` for props bot.
desrosj Apr 4, 2024
18b6df9
Make e2e tests callable.
desrosj Apr 4, 2024
565154b
Make PHP compatibility testing callable.
desrosj Apr 5, 2024
4737fc0
Clean up job details in callable workflows.
desrosj Apr 5, 2024
69fb1f4
Move environment variables to callable workflow.
desrosj Apr 5, 2024
29180d5
Rename PHPUnit callable workflow.
desrosj Apr 5, 2024
ca566d4
Some step name cleanup.
desrosj Apr 5, 2024
d0fef19
Merge remote-tracking branch 'upstream/trunk' into try/make-workflows…
desrosj Apr 11, 2024
3564398
Change E2E workflow to accept inputs.
desrosj Apr 11, 2024
cf8fcb7
Change step naming.
desrosj Apr 11, 2024
03de504
Merge remote-tracking branch 'upstream/trunk' into try/make-workflows…
desrosj Apr 22, 2024
8fe4efd
Allow a PHP version to be passed for PHPCS.
desrosj Apr 22, 2024
88f6cc1
Allow E2E workflow to accept PUPPETEER_SKIP_DOWNLOAD.
desrosj Apr 22, 2024
5e88bfe
Only download Playwright then Puppeteer is disabled.
desrosj Apr 22, 2024
bafd5b8
Remove puppeteer overrides.
desrosj Apr 22, 2024
9c2c5cc
Add a note that 6.3 and lower have a different file.
desrosj Apr 22, 2024
91f746d
Make performance workflow callable.
desrosj Apr 24, 2024
557834e
Merge remote-tracking branch 'upstream/trunk' into try/make-workflows…
desrosj May 6, 2024
c995736
Adjust job names.
desrosj May 6, 2024
53d24b6
Allow the emoji script to be skipped.
desrosj May 6, 2024
98dd392
Fix syntax error.
desrosj May 6, 2024
3760af7
Allow the calling workflow to skip installing Gutenberg.
desrosj May 6, 2024
7c27a9c
Allow options for `composer-install` to be passed.
desrosj May 7, 2024
5731a41
Allow options for `composer-install` to be passed.
desrosj May 7, 2024
778f3b9
Allow for PHP 5.6 and 7.0 in old branches to run tests.
desrosj May 7, 2024
ed49a64
Adjust legacy PHPUnit install.
desrosj May 7, 2024
0501196
Allow custom way to invoke PHPunit.
desrosj May 7, 2024
90023f5
Fix syntax error.
desrosj May 7, 2024
fdcb160
Revert "Fix syntax error."
desrosj May 8, 2024
e6ff5b2
Revert "Allow custom way to invoke PHPunit."
desrosj May 8, 2024
916996e
Revert "Adjust legacy PHPUnit install."
desrosj May 8, 2024
ed1be28
Revert "Allow for PHP 5.6 and 7.0 in old branches to run tests."
desrosj May 8, 2024
956f268
Revert "Allow options for `composer-install` to be passed."
desrosj May 8, 2024
2b65289
Revert "Allow options for `composer-install` to be passed."
desrosj May 8, 2024
ee81eff
Merge remote-tracking branch 'upstream/trunk' into try/make-workflows…
desrosj May 14, 2024
87ebbc8
Some adjustments to docs.
desrosj May 14, 2024
f204685
Add the ability to pass PHP version for compatibility scanner.
desrosj May 14, 2024
152ac5a
Rename upgrade testing workflow for new pattern.
desrosj May 14, 2024
51c4d59
Add PHP version to the cache key.
desrosj May 17, 2024
d5086b8
Replace "callable" with "reusable".
desrosj May 17, 2024
508947e
Test the new workflow file for upgrade testing.
desrosj May 17, 2024
412f1c1
Test branch name didn't change.
desrosj May 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 3 additions & 114 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,132 +45,21 @@ concurrency:
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.
# Runs the PHP coding standards checks.
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
uses: desrosj/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@try/make-workflows-callable
permissions:
contents: read
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up PHP
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0
with:
php-version: 'latest'
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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
.cache/phpcs-src.json
.cache/phpcs-tests.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@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.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 --cache=./.cache/phpcs-src.json --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 --cache=./.cache/phpcs-tests.json --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

# 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
uses: desrosj/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@try/make-workflows-callable
permissions:
contents: read
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
env:
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
cache: npm

- name: Log debug information
run: |
npm --version
node --version
git --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
Expand Down
95 changes: 4 additions & 91 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,105 +36,18 @@ env:

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.
# - Install Playwright browsers.
# - 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.
# - Install Gutenberg.
# - Run the E2E tests.
# - Ensures version-controlled files are not modified or deleted.
e2e-tests:
name: E2E Tests with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
runs-on: ubuntu-latest
name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
uses: desrosj/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@try/make-workflows-callable
permissions:
contents: read
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
LOCAL_SCRIPT_DEBUG: [ true, false ]

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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
cache: npm

- name: Log debug information
run: |
npm --version
node --version
curl --version
git --version
locale -a

- name: Install npm Dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- 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 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
env:
LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}
run: npm run env:install

- name: Install Gutenberg
run: npm run env:cli -- plugin install gutenberg --path=/var/www/${{ env.LOCAL_DIR }}

- name: Run E2E tests
run: npm run test:e2e

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: always()
with:
name: failures-artifacts${{ matrix.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }}
path: artifacts
if-no-files-found: ignore

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
with:
LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}

slack-notifications:
name: Slack Notifications
Expand Down
40 changes: 2 additions & 38 deletions .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,50 +43,14 @@ concurrency:
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.
# Runs the WordPress Core JavaScript tests.
test-js:
name: QUnit Tests
runs-on: ubuntu-latest
uses: desrosj/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@try/make-workflows-callable
permissions:
contents: read
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
cache: npm

- name: Log debug information
run: |
npm --version
node --version
git --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
Expand Down
Loading
Loading