forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
GitHub Actions #2
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
Closed
Closed
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d98b9f1
Add GitHub Actions workflows for everything currently handled in Trav…
desrosj 6e546ab
Indicate that JS standards are also checked in this workflow.
desrosj d10a9a9
Continuing to refine:
desrosj bb92995
Be more explicit within `on` and use human readable part of `check_na…
desrosj 690dc97
Merge branch 'master' into trac/50401-add-github-actions
desrosj c8d9481
Admin Menu: Better wrapping for long menu item names.
helen e72f248
Merge updates.
desrosj 0aa3ade
Updates: Reduce secondary buttons for less visual complexity.
helen d0ec93f
I18N: Use `wp.i18n` for translatable strings in `wp-admin/js/dashboar…
ocean90 52f2d0d
Community Events: Update timezone-related `@since` tags to `5.5.2`.
iandunn 50fa352
Docs: Improve description of the `$email` parameter in `email_exists()`.
SergeyBiryukov efe06cd
Site Health, REST API: Move async tests to REST API endpoints.
TimothyBJacobs 73fb2c1
REST API: Grant super admin to site health test user.
TimothyBJacobs 701dee2
REST API: Exclude custom site health capability check on multisite.
TimothyBJacobs 46a598a
Limit push runs to master and version branches.
desrosj ed611d8
Limit when actions run.
desrosj 8e53b26
Improve language of welcome message.
desrosj c978c99
Let's stay on PHP 7.4 for PHPCS testing until we verify our tooling i…
desrosj 2092637
Node needs to be installed before caching.
desrosj 277c3eb
Make the version of Node dynamic based on the `.nvmrc` file.
desrosj 7b73653
Detect the desired NodeJS version dynamically.
desrosj d009960
`actions/setup-node` does not currently support aliases like LTS
desrosj b0c0739
Remove stray nvmrc reference.
desrosj 8bf847b
Comments: Remove extra space from the comment link in `Walker_Comment`.
SergeyBiryukov 7bfe507
Twenty Twenty: Remove extra space from the comment link in `TwentyTwe…
SergeyBiryukov fee906a
Twenty Nineteen: Remove extra space from the comment link in `TwentyN…
SergeyBiryukov c0f41b5
Comments: Further remove unnecessary context switch in `Walker_Comment`.
SergeyBiryukov ec260b0
Merge branch 'master' into trac/50401-add-github-actions
desrosj f138386
Introduce a jshint warning.
desrosj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| name: Coding Standards | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| # PHPCS checking was introduced in WordPress 5.1. | ||
| - '5.[1-9]' | ||
| - '[6-9].*' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| # Runs PHP coding standards checks. | ||
| # | ||
| # Violations are reported inline with annotations. | ||
| # | ||
| # Performs the following steps: | ||
| # - Checks out the repository. | ||
| # - Configures caching for Composer. | ||
| # - Sets up PHP. | ||
| # - Logs debug information. | ||
| # - Installs Composer dependencies (from cache if possible). | ||
| # - Logs PHP_CodeSniffer debug information. | ||
| # - Runs PHPCS on the full codebase with warnings suppressed. | ||
| # - Runs PHPCS on the `tests` directory without warnings suppressed. | ||
| # - todo: Configure Slack notifications for failing scans. | ||
| phpcs: | ||
| name: PHP coding standards | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Get Composer cache directory | ||
| id: composer-cache | ||
| run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
|
||
| - name: Set up Composer caching | ||
| uses: actions/cache@v2 | ||
| env: | ||
| cache-name: cache-composer-dependencies | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-composer- | ||
|
|
||
| - name: Set up PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '7.4' | ||
| coverage: none | ||
| tools: composer, cs2pr | ||
|
|
||
| - name: Log debug information | ||
| run: | | ||
| php --version | ||
| composer --version | ||
|
|
||
| - name: Install Composer dependencies | ||
| run: | | ||
| composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction | ||
| echo "vendor/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Log PHPCS debug information | ||
| run: phpcs -i | ||
|
|
||
| - name: Run PHPCS on all Core files | ||
| run: vendor/bin/phpcs -q -n --report=checkstyle | cs2pr | ||
|
|
||
| - name: Check test suite files for warnings | ||
| run: vendor/bin/phpcs tests -q --report=checkstyle | cs2pr | ||
|
|
||
| # Runs the JavaScript coding standards checks. | ||
| # | ||
| # Performs the following steps: | ||
| # - Checks out the repository. | ||
| # - Logs debug information about the runner container. | ||
| # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches) | ||
| # - Sets up caching for NPM. | ||
| # - Logs updated debug information. | ||
| # _ Installs NPM dependencies. | ||
| # - Run the WordPress JSHint checks. | ||
| # - todo: Configure Slack notifications for failing tests. | ||
| jshint: | ||
| name: JavaScript coding standards | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Log debug information | ||
| run: | | ||
| npm --version | ||
| node --version | ||
| git --version | ||
| svn --version | ||
|
|
||
| - name: Install NodeJS | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: 12 | ||
|
|
||
| - name: Cache NodeJS modules | ||
| uses: actions/cache@v2 | ||
| env: | ||
| cache-name: cache-node-modules | ||
| with: | ||
| # npm cache files are stored in `~/.npm` on Linux/macOS | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-npm- | ||
|
|
||
| - name: Log debug information | ||
| run: | | ||
| npm --version | ||
| node --version | ||
|
|
||
| - name: Install Dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run JSHint | ||
| run: npm run grunt jshint | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| name: End-to-end Tests | ||
|
|
||
| on: | ||
| push: | ||
desrosj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| branches: | ||
| - master | ||
| # The end to end test suite was introduced in WordPress 5.3. | ||
| - '5.[3-9]' | ||
| - '[6-9].*' | ||
| pull_request: | ||
|
|
||
| env: | ||
| LOCAL_DIR: build | ||
|
|
||
| jobs: | ||
| # Runs the end-to-end test suite. | ||
| # | ||
| # Performs the following steps: | ||
| # - Cancels all previous workflow runs that have not completed. | ||
| # - Set environment variables. | ||
| # - Checks out the repository. | ||
| # - Logs debug information about the runner container. | ||
| # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches) | ||
| # - Sets up caching for NPM. | ||
| # _ Installs NPM dependencies. | ||
| # - Builds WordPress to run from the `build` directory. | ||
| # - Starts the WordPress Docker container. | ||
| # - Logs general debug information. | ||
| # - 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. | ||
| # - todo: Configure Slack notifications for failing tests. | ||
| e2e-tests: | ||
| name: E2E Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Cancel previous runs of this workflow | ||
| uses: styfle/[email protected] | ||
| with: | ||
| access_token: ${{ github.token }} | ||
|
|
||
| - 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@v2 | ||
|
|
||
| - name: Log debug information | ||
| run: | | ||
| npm --version | ||
| node --version | ||
| curl --version | ||
| git --version | ||
| svn --version | ||
| php --version | ||
| php -i | ||
| locale -a | ||
|
|
||
| - name: Install NodeJS | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: 12 | ||
|
|
||
| - name: Cache NodeJS modules | ||
| uses: actions/cache@v2 | ||
| env: | ||
| cache-name: cache-node-modules | ||
| with: | ||
| # npm cache files are stored in `~/.npm` on Linux/macOS | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-npm- | ||
|
|
||
| - name: Install Dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build WordPress | ||
| run: npm run build | ||
|
|
||
| - name: Start Docker environment | ||
| run: | | ||
| npm run env:start | ||
|
|
||
| - name: General debug information | ||
| run: | | ||
| npm --version | ||
| node --version | ||
| curl --version | ||
| git --version | ||
| svn --version | ||
|
|
||
| - 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 | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: JavaScript Tests | ||
|
|
||
| on: | ||
| push: | ||
desrosj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| branches: | ||
| - master | ||
| - '*.*' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| # Runs the QUnit tests for WordPress. | ||
| # | ||
| # Performs the following steps: | ||
| # - Cancels all previous workflow runs that have not completed. | ||
| # - Checks out the repository. | ||
| # - Logs debug information about the runner container. | ||
| # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches) | ||
| # - Sets up caching for NPM. | ||
| # - Logs updated debug information. | ||
| # _ Installs NPM dependencies. | ||
| # - Run the WordPress QUnit tests. | ||
| # - todo: Configure Slack notifications for failing tests. | ||
| test-js: | ||
| name: QUnit Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Cancel previous runs of this workflow | ||
| uses: styfle/[email protected] | ||
| with: | ||
| access_token: ${{ github.token }} | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Log debug information | ||
| run: | | ||
| npm --version | ||
| node --version | ||
| git --version | ||
| svn --version | ||
|
|
||
| - name: Install NodeJS | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: 12 | ||
|
|
||
| - name: Cache NodeJS modules | ||
| uses: actions/cache@v2 | ||
| env: | ||
| cache-name: cache-node-modules | ||
| with: | ||
| # npm cache files are stored in `~/.npm` on Linux/macOS | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-npm- | ||
|
|
||
| - name: Log debug information | ||
| run: | | ||
| npm --version | ||
| node --version | ||
|
|
||
| - name: Install Dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run QUnit tests | ||
| run: npm run grunt qunit:compiled | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: PHP Compatibility | ||
|
|
||
| on: | ||
| push: | ||
desrosj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| branches: | ||
| - master | ||
| # The PHP compatibility testing was introduced in WordPress 5.5. | ||
| - '5.[5-9]' | ||
| - '[6-9].*' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
|
|
||
| # Runs PHP compatibility testing. | ||
| # | ||
| # Violations are reported inline with annotations. | ||
| # | ||
| # Performs the following steps: | ||
| # - Checks out the repository. | ||
| # - Configures caching for Composer. | ||
| # - Sets up PHP. | ||
| # - Logs debug information about the runner container. | ||
| # - Installs Composer dependencies (from cache if possible). | ||
| # - Logs PHP_CodeSniffer debug information. | ||
| # - Runs the PHP compatibility tests. | ||
| # - todo: Configure Slack notifications for failing scans. | ||
| php-comatibility: | ||
| name: Check PHP compatibility | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Get Composer cache directory | ||
| id: composer-cache | ||
| run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
|
||
| - name: Set up Composer caching | ||
| uses: actions/cache@v2 | ||
| env: | ||
| cache-name: cache-composer-dependencies | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-composer- | ||
|
|
||
| - name: Set up PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '7.4' | ||
| coverage: none | ||
| tools: composer, cs2pr | ||
|
|
||
| - name: Log debug information | ||
| run: | | ||
| php --version | ||
| composer --version | ||
|
|
||
| - name: Install Composer dependencies | ||
| run: | | ||
| composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction | ||
| echo "vendor/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Run PHP compatibility tests | ||
| run: vendor/bin/phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.