-
Notifications
You must be signed in to change notification settings - Fork 17
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
Migrate Travis jobs to GitHub actions #317
base: develop
Are you sure you want to change the base?
Conversation
@derekherman @kasparsd This is ready for review. |
@@ -0,0 +1,162 @@ | |||
name: Coding Standards and Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont we need to composer install as well here?
strategy: | ||
fail-fast: false | ||
matrix: | ||
php_versions: [7.4, 7.3, 7.2, 7.1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add PHP 8 here.
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can install via composer.
@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-lib
ubuntu-*
image to run PHP tests, using docker to run these tests will increase the time.npm run env:start
to 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