-
Notifications
You must be signed in to change notification settings - Fork 72
Switch to GitHub Actions #143
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9d18725
First attempt to use GitHub Actions.
desrosj ec86ffa
Use correct names. Don't run on push for PRs.
desrosj 3358d55
generate `.ssh` folder if not existent
pfefferle d551cae
re-add travis file
pfefferle 66ced63
add scheduler example
pfefferle cb4576c
add env vars as example
pfefferle c2fe22c
Add `continue-on-error: true` for phpunit
pfefferle 9972040
Add some doc
pfefferle 6080a4e
change caching
pfefferle 1631b97
Revert "change caching"
pfefferle cdbe3f5
Use GHA native `concurrency` to cancel duplicate workflow runs.
desrosj aabc6d4
Use caching built into `actions/setup-node`.
desrosj a47082b
Use commit SHAs for third-party actions.
desrosj dcc7b2b
Improve documentation.
desrosj eddcad5
Change the `schedule` example to match the suggestions on https://mak…
desrosj ec143fa
More documentation improvements.
desrosj 7c72203
Remove Remove `push` and `pull_request` events.
desrosj 01652cb
Add a condition to disable the workflow.
desrosj bc5bd6d
Remove `npm` caching from the example GHA workflow.
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,91 @@ | ||
| name: WordPress PHPUnit tests | ||
|
|
||
| on: | ||
| # The workflow should be run on a schedule using the 'schedule' event trigger. | ||
| # | ||
| # For more details on how to configure the schedule event, see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule. | ||
| # | ||
| # Below are some options for different schedules. Running the tests every hour is recommended, | ||
| # but every 3-6 hours is also helpful. Times are in UTC. | ||
| schedule: | ||
| # By default, the workflow will run every hour. | ||
| - cron: '0 * * * *' | ||
| # Every 3 hours. | ||
| # - cron: '0 0/3 * * *' | ||
| # Every 6 hours. | ||
| # - cron: '0 0/6 * * *' | ||
| # Every 12 hours. | ||
| # - cron: '0 0/12 * * *' | ||
| # Once per day at 00:00. | ||
| # - cron: '0 0 * * *' | ||
| # Every 30 minutes. | ||
| # - cron: '0/30 * * * *' | ||
|
|
||
| # 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 | ||
|
|
||
| jobs: | ||
| # Tests the PHPUnit test runner. | ||
| # | ||
| # Performs the following steps: | ||
| # - Checks out the repository. | ||
| # - Installs PHP. | ||
| # - Installs NodeJS 14 with caching configured. | ||
| # - Prepares the environment for tests. | ||
| # - Runs the tests. | ||
| # - Reports the results. | ||
| # - Cleans up. | ||
| test: | ||
| name: Run Core PHPUnit tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # Remove this line if Github Actions is your preferred means of running the tests. | ||
| if: never() | ||
|
|
||
| env: | ||
| # This is only a subset/example of env vars available. See the `.env.default` file for a full list. | ||
| WPT_PREPARE_DIR: ${{ secrets.WPT_PREPARE_DIR }} | ||
| WPT_TEST_DIR: ${{ secrets.WPT_TEST_DIR }} | ||
| WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} | ||
| WPT_PHP_EXECUTABLE: ${{ secrets.WPT_PHP_EXECUTABLE }} | ||
| # Database settings | ||
| WPT_DB_NAME: ${{ secrets.WPT_DB_NAME }} | ||
| WPT_DB_USER: ${{ secrets.WPT_DB_USER }} | ||
| WPT_DB_PASSWORD: ${{ secrets.WPT_DB_PASSWORD }} | ||
| WPT_DB_HOST: ${{ secrets.WPT_DB_HOST }} | ||
| # SSH settings for connecting to the test environment. | ||
| WPT_SSH_CONNECT: ${{ secrets.WPT_SSH_CONNECT }} | ||
| WPT_SSH_PRIVATE_KEY_BASE64: ${{ secrets.WPT_SSH_PRIVATE_KEY_BASE64 }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 | ||
|
|
||
| - name: Set up PHP | ||
| uses: shivammathur/setup-php@947009a71769c25ab5292f073f5343624b7c879d # v2.12.0 | ||
| with: | ||
| php-version: '7.4' | ||
| coverage: none | ||
|
|
||
| - name: Install NodeJS | ||
| uses: actions/setup-node@25316bbc1f10ac9d8798711f44914b1cf3c4e954 # v2.4.0 | ||
| with: | ||
| node-version: 14 | ||
|
|
||
| - name: Prepare environment | ||
| run: php prepare.php | ||
|
|
||
| - name: Run unit tests | ||
| run: php test.php | ||
| # Prevent the workflow from stopping if there are test failures. | ||
| continue-on-error: true | ||
|
|
||
| - name: Report the results | ||
| run: php report.php | ||
|
|
||
| - name: Cleanup | ||
| run: php cleanup.php | ||
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
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
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.