Skip to content

Merge pull request #210 from Automattic/dependabot/github_actions/act… #35

Merge pull request #210 from Automattic/dependabot/github_actions/act…

Merge pull request #210 from Automattic/dependabot/github_actions/act… #35

Workflow file for this run

name: Unit Tests
on:
push:
branches:
- develop
- trunk
paths:
- '**.php'
- 'composer.json'
- 'phpunit.xml.dist'
- '.github/workflows/unit.yml'
pull_request:
paths:
- '**.php'
- 'composer.json'
- 'phpunit.xml.dist'
- '.github/workflows/unit.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.1'
- '8.2'
- '8.3'
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Install Composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run unit tests
run: composer test:unit