Skip to content

Commit

Permalink
Updated actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaydsouza committed Oct 15, 2024
1 parent 2a86454 commit 1eaeca5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '7.4'
tools: cs2pr
coverage: none

Expand All @@ -38,7 +38,7 @@ jobs:
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"

- name: 'Run Composer Update'
run: |
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ jobs:
matrix:
# Notes regarding supported versions in WP:
# The base matrix only contains the PHP versions which are supported on all supported WP versions.
php: ['7.2', '7.3', '7.4','8.0']
php: ['8.0', '7.3', '7.4']
wp: ['latest']
experimental: [false]

include:
# Complement the builds run via the matrix with high/low WP builds for PHP 7.4 and 8.0.
# PHP 8.0 is sort of supported since WP 5.6.
# PHP 7.4 is supported since WP 5.3.
- php: '8.1'
- php: '8.3'
wp: 'latest'
experimental: true
- php: '8.0'
wp: '5.6'
- php: '8.2'
wp: 'latest'
experimental: true
- php: '7.4'
wp: '5.5'
- php: '8.1'
wp: 'latest'
experimental: true
- php: '7.4'
wp: 'nightly'
- php: '8.0'
wp: '5.9'
experimental: true

name: 'PHP ${{ matrix.php }} - WP ${{ matrix.wp }}'
name: "PHP ${{ matrix.php }} - WP ${{ matrix.wp }}"

continue-on-error: ${{ matrix.experimental }}

Expand All @@ -65,7 +65,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -84,25 +84,27 @@ jobs:
- name: Determine supported PHPUnit version
id: set_phpunit
run: |
if [[ "${{ matrix.php }}" > "8.0" ]]; then
echo '::set-output name=PHPUNIT::9.*'
if [[ "${{ matrix.php }}" > "7.4" ]]; then
echo "PHPUNIT=8.5.*" >> $GITHUB_ENV
else
echo '::set-output name=PHPUNIT::5.7.*||6.*||7.5.*'
echo "PHPUNIT=5.7.*||6.*||7.5.*" >> $GITHUB_ENV
fi
- name: 'Composer: set up PHPUnit'
run: composer require --no-update phpunit/phpunit:"${{ steps.set_phpunit.outputs.PHPUNIT }}"
env:
PHPUNIT: ${{ env.PHPUNIT }}
run: composer require --no-update phpunit/phpunit:"${{ env.PHPUNIT }}"

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies for PHP < 8.0
if: ${{ matrix.php < 8.0 }}
uses: 'ramsey/composer-install@v2'
uses: "ramsey/composer-install@v3"

# For the PHP 8.0 and above, we need to install with ignore platform reqs as not all dependencies allow it yet.
- name: Install Composer dependencies for PHP >= 8.0
if: ${{ matrix.php >= 8.0 }}
uses: 'ramsey/composer-install@v2'
uses: "ramsey/composer-install@v3"
with:
composer-options: --ignore-platform-reqs

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zipitup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build project
run: |
mkdir build
Expand All @@ -31,7 +31,7 @@ jobs:
with:
args: zip -X -r build/knowledgebase.zip . -x *.git* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.yml composer.* dev-helpers** build** wporg-assets** phpunit**
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: knowledgebase
path: build/knowledgebase.zip
Expand Down

0 comments on commit 1eaeca5

Please sign in to comment.