Skip to content

Simplify tests workflow #155

Simplify tests workflow

Simplify tests workflow #155

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
phpUnitTests:
strategy:
matrix:
operatingSystem: [ubuntu-latest]
phpVersion: ['8.0', '8.1', '8.2', '8.3']
winterBranch: ['develop']
include:
- phpVersion: '7.4'
winterBranch: '1.1'
fail-fast: false
name: PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterBranch }}
runs-on: ${{ matrix.operatingSystem }}
env:
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
steps:
- name: Checkout Winter CMS
uses: actions/checkout@v4
with:
repository: wintercms/winter
ref: ${{ matrix.winterBranch }}
- name: Checkout changes
uses: actions/checkout@v2
with:
path: plugins/winter/user
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.phpVersion }}
tools: composer:v2
extensions: ${{ env.extensions }}
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-scripts
- name: Run linting
run: ./vendor/bin/parallel-lint plugins/winter/user
- name: Run unit tests (develop branch)
if: matrix.winterBranch != '1.1'
run: php artisan winter:test -p Winter.User -- --testdox
- name: Run unit tests (1.1 branch)
if: matrix.winterBranch == '1.1'
working-directory: plugins/winter/user
run: ../../../vendor/bin/phpunit --bootstrap ../../../tests/bootstrap.php --testdox