From 9217896ebab152c8c6e413b4cdc65078333a84f2 Mon Sep 17 00:00:00 2001 From: Bruno FG Date: Sat, 10 Feb 2024 16:48:36 +1100 Subject: [PATCH] Update actions to test new unit test set up --- .github/workflows/run-phpunit.yml | 62 ++++++++++++------------------- .gitignore | 1 + 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/.github/workflows/run-phpunit.yml b/.github/workflows/run-phpunit.yml index ca171af..2c7f0a1 100644 --- a/.github/workflows/run-phpunit.yml +++ b/.github/workflows/run-phpunit.yml @@ -11,53 +11,37 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - php-test: - name: PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}${{ matrix.experimental && ' (experimental)' || '' }} + build: runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - fail-fast: true - matrix: - php: - - '8.0' - - '8.1' - - '8.2' - wordpress: [ 'latest' ] - experimental: [false] - include: - - php: '8.0' - wordpress: '6.1' - - php: '8.2' - wordpress: 'trunk' - experimental: true - env: - WP_ENV_PHP_VERSION: ${{ matrix.php }} - WP_ENV_CORE: ${{ matrix.wordpress == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }} - continue-on-error: ${{ matrix.experimental == true }} steps: - - uses: styfle/cancel-workflow-action@0.11.0 + - uses: actions/checkout@v2 - - uses: actions/checkout@v3 - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - - - name: Setup Node.js (.nvmrc) - uses: actions/setup-node@v3 + - name: Setup Node + uses: actions/setup-node@v2 with: node-version-file: '.nvmrc' - cache: npm - - name: npm install - run: npm ci + - name: Install NPM Dependencies + run: npm install - - name: Install WordPress - run: npm run wp-env start + - name: Start WordPress Environment + run: npm run start-env - - name: Running PHPUnit tests + - name: Run PHPUnit Tests run: npm run test-php - - name: Running PHPUnit tests for multisite - run: npm run test-php-multisite + - name: Stop WordPress Environment + run: npm run stop-env + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: composer:v2 + + - name: Install Composer Dependencies + run: composer install --no-progress + + - name: Run PHP CodeSniffer + run: ./vendor/bin/phpcs \ No newline at end of file diff --git a/.gitignore b/.gitignore index e808396..a620b4c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ coverage.xml *.txt node_modules/ package-lock.json +.idea