Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 38 additions & 23 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
name: run-tests

on: [push, pull_request]
name: Pest Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:

tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.4]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
php-version: ['8.4']

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

- name: Install sed
run: sudo apt-get install sed
Expand All @@ -29,21 +27,38 @@ jobs:
- name: Patch SSH Daemon
run: sudo sed -ri 's/^#? StrictHostKeyChecking ask/StrictHostKeyChecking no/g' /etc/ssh/ssh_config

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
php-version: ${{ matrix.php-version }}
extensions: mbstring, dom, fileinfo, mysql, redis
coverage: xdebug

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-composer-

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run PEST tests
run: composer run test

- name: Execute tests
run: vendor/bin/pest
- name: Run PEST with coverage
if: matrix.php-version == '8.4'
run: composer run test:coverage-clover

- name: Upload coverage reports to Coveralls
if: matrix.php-version == '8.4'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./coverage/clover.xml
Loading