Migrate Travis jobs to GitHub actions#317
Conversation
|
@derekherman @kasparsd This is ready for review. |
| @@ -0,0 +1,162 @@ | |||
| name: Coding Standards and Tests | |||
There was a problem hiding this comment.
I think it is cleaner to have this as different workflows in different files.
A good example of this would this project - https://github.com/google/web-stories-wp/tree/main/.github/workflows
I would break into following files.
- test-php.yml
- test-js.yml
- lint-js-css.yml
- lint-php.yml
- test-e2e.yml
| on: | ||
| push: | ||
| branches: | ||
| - master |
There was a problem hiding this comment.
Should this be main or include main
| run: npm ci | ||
|
|
||
| - name: Run coding standards check | ||
| run: npm run lint |
There was a problem hiding this comment.
You can pipe lint results into cs2pr. This will highlight the line errors. Here is an example.
|
|
||
| env: | ||
| NODE_ENV: e2e | ||
| WP_VERSION: 5.7 |
There was a problem hiding this comment.
Why is this hardcoded to 5.7? Travis just uses latest
https://github.com/xwp/wp-foo-bar/blob/develop/.travis.yml#L71
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
There was a problem hiding this comment.
Dont we need to composer install as well here?
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php_versions: [7.4, 7.3, 7.2, 7.1] |
| - name: Install and Run tests | ||
| if: ${{ matrix.php_versions == '7.0' || matrix.php_versions == '5.6.20' }} | ||
| run: | | ||
| wget -O bin/phpunit https://phar.phpunit.de/phpunit-5.phar | ||
| chmod +x bin/phpunit | ||
| source bin/php-tests.sh wordpress_test root root localhost false bin/phpunit |
|
@ravichdev I have posted some thoughts here. I have a lot of experience with github actions. We can copy and paste lots of work done elsewhere, like in web stories. Also, can we enable github actions, see can these running. |
Summary
wp-dev-libubuntu-*image to run PHP tests, using docker to run these tests will increase the time.npm run env:startto setup local docker env and this is resulting in the job taking ~4 minutes. This could also be improved if we use apache or nginx bundled in the baseubuntu-*image instead of docker.Test PR actions - https://github.com/ravichdev/wp-foo-bar/actions/runs/684218426
Fixes #
Checklist