From 9ab17f548b65c9495d7a790ebac37b53785ff65c Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Fri, 9 Jun 2023 20:42:55 +0530 Subject: [PATCH] dev: update test github workflow --- .github/workflows/test.yml | 67 +++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c769f53a6..1651f4347 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: PHPUnit Tests env: COMPOSER_VERSION: "2" @@ -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 }} @@ -29,33 +26,35 @@ jobs: os: [ ubuntu-latest ] steps: - - name: Checkout - uses: actions/checkout@v2.4.0 - - - 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/setup-php@2.17.0 - 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/checkout@v2.4.0 + + - 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/mariadb-action@v1.1 + + - name: Set PHP version + uses: shivammathur/setup-php@2.17.0 + 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