Skip to content

Commit f4bc140

Browse files
committed
Update GitHub action
1 parent baeaed7 commit f4bc140

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,50 @@ name: Coding Standards and Tests
33
on: [ push ]
44

55
env:
6-
WP_TESTS_DIR: /github/home/wp-tests/wordpress-tests-lib
7-
WP_CORE_DIR: /github/home/wp-tests/wordpress
6+
WP_TESTS_DIR: /home/runner/wp-tests/wordpress-tests-lib
7+
WP_CORE_DIR: /home/runner/wp-tests/wordpress
88

99
jobs:
1010

1111
test:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
php-version: [ 5.6, 7.3, 7.4 ]
15+
php-version: [ '5.6', '7.3', '7.4' ]
1616
wordpress-version: [ latest ]
17-
container:
18-
image: junaidbhura/wp-tests:php-${{ matrix.php-version }}
1917
services:
2018
mysql:
2119
image: mysql:5.7.27
2220
env:
2321
MYSQL_ROOT_PASSWORD: root
22+
MYSQL_DATABASE: wordpress_test
23+
ports:
24+
- 3306:3306
25+
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=5s --health-retries=3
2426

2527
steps:
28+
- name: Set up PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
coverage: none
33+
tools: composer, cs2pr
34+
2635
- name: Checkout repository
27-
uses: actions/checkout@v1
36+
uses: actions/checkout@v2
2837

2938
- name: Composer cache
3039
id: composer-cache
31-
uses: actions/cache@v1
40+
uses: actions/cache@v2
3241
with:
33-
path: /github/home/.composer/vendor
34-
key: composer-${{ hashFiles( '.github/workflows/main.yml' ) }}-${{ matrix.php-version }}
42+
path: /home/runner/.composer/vendor
43+
key: composer-${{ hashFiles( '.github/workflows/main.yml' ) }}
3544

3645
- name: WordPress test suite cache
3746
id: wp-test-suite
38-
uses: actions/cache@v1
47+
uses: actions/cache@v2
3948
with:
40-
path: /github/home/wp-tests
49+
path: /home/runner/wp-tests
4150
key: wp-tests-${{ hashFiles( '.github/workflows/main.yml' ) }}-${{ matrix.wordpress-version }}
4251

4352
- name: Install Composer dependencies
@@ -47,17 +56,11 @@ jobs:
4756
composer global require wp-coding-standards/wpcs
4857
$HOME/.composer/vendor/bin/phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
4958
50-
- name: Wait for MySQL
51-
run: |
52-
while ! mysqladmin ping -h mysql -u root -p${MYSQL_ROOT_PASSWORD}; do
53-
sleep 1
54-
done
55-
5659
- name: Install WordPress test suite
57-
run: bash bin/install-wp-tests.sh wordpress_test root root mysql ${{ matrix.wordpress-version }}
60+
run: bash bin/install-wp-tests.sh wordpress_test root root 0.0.0.0 ${{ matrix.wordpress-version }} true
5861

5962
- name: Coding standards
6063
run: $HOME/.composer/vendor/bin/phpcs phpcs.ruleset.xml
6164

62-
- name: Unit tests
65+
- name: Tests
6366
run: $HOME/.composer/vendor/bin/phpunit

0 commit comments

Comments
 (0)