Skip to content

Commit

Permalink
dev: update test github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed Jun 9, 2023
1 parent 4bac73c commit 9ab17f5
Showing 1 changed file with 33 additions and 34 deletions.
67 changes: 33 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: PHPUnit Tests

env:
COMPOSER_VERSION: "2"
Expand All @@ -10,15 +10,12 @@ on:
push:
branches:
- develop
- develop-v1
- trunk
pull_request:
branches:
- develop
- develop-v1

jobs:

phpunit:
name: ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -29,33 +26,35 @@ jobs:
os: [ ubuntu-latest ]

steps:
- name: Checkout
uses: actions/[email protected]

- name: Set standard 10up cache directories
run: |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
- name: Prepare composer cache
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE }}
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ env.COMPOSER_VERSION }}-
- name: Set PHP version
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
coverage: none
tools: phpunit-polyfills, composer:v2

- name: Install dependencies
run: composer update -W

- name: Setup WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1

- name: PHPUnit
run: './vendor/bin/phpunit'
- name: Checkout
uses: actions/[email protected]

- name: Set standard 10up cache directories
run: |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
- name: Prepare composer cache
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE }}
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ env.COMPOSER_VERSION }}-
- uses: getong/[email protected]

- name: Set PHP version
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
coverage: none
tools: phpunit-polyfills, composer:v2

- name: Install dependencies
run: composer update -W

- name: Setup WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1

- name: PHPUnit
run: composer run test

0 comments on commit 9ab17f5

Please sign in to comment.