From 53ac22727f8093ba346e3db4be5faff5605131d2 Mon Sep 17 00:00:00 2001 From: Austin Passy <367897+thefrosty@users.noreply.github.com> Date: Sun, 14 Dec 2025 11:38:22 -0800 Subject: [PATCH 1/3] Update workflow versions --- .github/workflows/publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f6b5ffc..09ab239 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set Release Version env run: | @@ -39,8 +39,7 @@ jobs: echo "Release Version: ${VERSION//v}" echo "RELEASE_VERSION=${VERSION//v}" >> $GITHUB_ENV - # see https://github.com/shivammathur/setup-php - - name: Use PHP 8.3 + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: "8.3" From 71a02b0d81ae88bee75dd7a6059378ea5b7e9d36 Mon Sep 17 00:00:00 2001 From: Austin Passy <367897+thefrosty@users.noreply.github.com> Date: Sun, 14 Dec 2025 11:38:30 -0800 Subject: [PATCH 2/3] Replaced with thefrosty/ci-setup@main --- .github/actions/ci-setup/action.yml | 70 ----------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .github/actions/ci-setup/action.yml diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml deleted file mode 100644 index 3b6f384..0000000 --- a/.github/actions/ci-setup/action.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: CI Setup -description: "Sets up the environment for jobs during CI workflow" -# https://alejandrocelaya.blog/2022/08/19/how-to-reduce-duplication-in-your-github-actions-workflows/ - -inputs: - extensions: - default: 'curl, mysql, zip' - description: 'shivammathur/setup-php extensions' - required: false - extensions-cache-key: - description: 'The key used to cache PHP extensions' - required: true - php-version: - description: 'The PHP version to be setup' - required: true - token: - description: 'A GitHub PAT' - required: true - tools: - default: 'composer' - description: 'shivammathur/setup-php tools' - required: false -outputs: - files: - description: 'All changed files' - value: ${{ steps.files.outputs.all }} - -runs: - using: composite - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup cache extensions - id: extcache - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ inputs.php-version }} - extensions: ${{ inputs.extensions }} - key: ${{ inputs.extensions-cache-key }} - - - name: Cache extensions - uses: actions/cache@v4 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - coverage: xdebug - extensions: ${{ inputs.extensions }} - tools: ${{ inputs.tools }} - - - name: Composer config - run: | - composer config github-oauth.github.com "${{ env.GITHUB_TOKEN }}" - env: - GITHUB_TOKEN: ${{ inputs.token }} - shell: bash - - - name: Composer update - run: composer update --no-interaction --optimize-autoloader - shell: bash - - - name: Get Changed Files - id: files - uses: masesgroup/retrieve-changed-files@v3 From 85433cecc904b2dd4a6050c8b5d97c4fdd44ffb0 Mon Sep 17 00:00:00 2001 From: Austin Passy <367897+thefrosty@users.noreply.github.com> Date: Sun, 14 Dec 2025 11:40:48 -0800 Subject: [PATCH 3/3] Update main workflow with thefrosty/ci-setup@main --- .github/workflows/main.yml | 56 ++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9096c71..59e784a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,12 @@ -name: Main PHP Version(s) CI +name: CI Setup on: - push: - branches: - - develop pull_request: # Cancels all previous workflow runs for the same branch that have not yet completed. concurrency: # The concurrency group contains the workflow name and the branch name. - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: @@ -21,11 +18,11 @@ jobs: php-version: [ "8.3", "8.4" ] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup id: ci-setup - uses: ./.github/actions/ci-setup + uses: thefrosty/ci-setup@main with: extensions: 'curl' extensions-cache-key: run-phpcs-${{ matrix.php-version }} @@ -48,6 +45,11 @@ jobs: run-phpunit: name: Run PHPUnit runs-on: ubuntu-latest + strategy: + matrix: + php-version: [ "8.3" ] + wp-version: [ 'latest' ] + coverage: [ true ] services: mysql: image: mysql:8.0 @@ -55,43 +57,45 @@ jobs: MYSQL_DATABASE: wordpress_test MYSQL_ROOT_PASSWORD: root ports: - - 3306/tcp - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - strategy: - matrix: - php-version: [ "8.3" ] - wp-versions: [ 'latest' ] - coverage: [ true ] + - "3306:3306" + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + env: + WORDPRESS_DB_NAME: wordpress_test + WORDPRESS_DB_PASS: root + WORDPRESS_DB_USER: root + steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install SVN run: sudo apt-get update && sudo apt-get install -y subversion - - name: Setup + - name: Setup PHP ${{ matrix.php-version }} id: ci-setup - uses: ./.github/actions/ci-setup + uses: thefrosty/ci-setup@main with: - extensions: 'curl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, tar, zip' - extensions-cache-key: run-phpunit-${{ matrix.php-version }} + extensions: 'curl, mysql, mysqli, zip' + extensions-cache-key: run-phpunit-${{ matrix.wp-version }}-${{ matrix.php-version }} php-version: ${{ matrix.php-version }} token: ${{ secrets.GITHUB_TOKEN }} - tools: 'composer, phpunit' + tools: 'composer, phpunit:11' - - name: Run PHPUnit - id: phpunit + - name: Setup WordPress ${{ matrix.wp-version }} run: | chmod u+x vendor/thefrosty/wp-utilities/bin/install-wp-tests.sh - ./vendor/thefrosty/wp-utilities/bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wp-versions }} true - composer phpunit + ./vendor/thefrosty/wp-utilities/bin/install-wp-tests.sh ${{ env.WORDPRESS_DB_NAME }} ${{ env.WORDPRESS_DB_USER }} ${{ env.WORDPRESS_DB_PASS }} 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wp-version }} true + + - name: Run PHPUnit + continue-on-error: false + id: phpunit + run: composer phpunit env: CHANGED_FILES: ${{ steps.ci-setup.outputs.files }} - WORDPRESS_DB_HOST: 127.0.0.1:${{ job.services.mysql.ports['3306'] }} + DB_PORT: ${{ job.services.mysql.ports[3306] }} - name: Upload coverage to Codecov if: ${{ github.event_name == 'pull_request' }} uses: codecov/codecov-action@v5 with: fail_ci_if_error: false - token: ${{ secrets.CODECOV_TOKEN }}