mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
86 lines
2.6 KiB
YAML
86 lines
2.6 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '1.0'
|
|
pull_request:
|
|
|
|
jobs:
|
|
phpUnitTests:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
max-parallel: 6
|
|
matrix:
|
|
phpVersion: ['7.1', '7.2', '7.3', '7.4']
|
|
fail-fast: false
|
|
name: Linux / PHP ${{ matrix.phpVersion }}
|
|
env:
|
|
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
|
|
key: october-cms-1-0-cache-v1
|
|
steps:
|
|
- name: Cancel previous incomplete runs
|
|
uses: styfle/cancel-workflow-action@0.8.0
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
|
|
- name: Checkout changes
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup extension cache
|
|
id: extcache
|
|
uses: shivammathur/cache-extensions@v1
|
|
with:
|
|
php-version: ${{ matrix.phpVersion }}
|
|
extensions: ${{ env.extensions }}
|
|
key: ${{ env.key }}
|
|
|
|
- name: Cache extensions
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.extcache.outputs.dir }}
|
|
key: ${{ steps.extcache.outputs.key }}
|
|
restore-keys: ${{ steps.extcache.outputs.key }}
|
|
|
|
- name: Install PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.phpVersion }}
|
|
tools: composer:v1
|
|
extensions: ${{ env.extensions }}
|
|
|
|
- name: Setup dependency cache
|
|
id: composercache
|
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.composercache.outputs.dir }}
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install --no-interaction --no-progress --no-scripts
|
|
|
|
- name: Reset Winter modules and library
|
|
run: |
|
|
git reset --hard HEAD
|
|
rm -rf ./vendor/winter/storm
|
|
wget https://github.com/wintercms/storm/archive/1.0.zip -O ./vendor/winter/1.0.zip
|
|
unzip ./vendor/winter/1.0.zip -d ./vendor/winter
|
|
mv ./vendor/winter/storm-1.0 ./vendor/winter/storm
|
|
composer dump-autoload
|
|
|
|
- name: Run post-update Composer scripts
|
|
run: php artisan package:discover
|
|
|
|
- name: Setup problem matchers for PHPUnit
|
|
if: matrix.phpVersion == '7.4'
|
|
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
|
|
|
- name: Run Linting and Tests
|
|
run: |
|
|
./vendor/bin/parallel-lint --exclude vendor --exclude storage --exclude tests/fixtures/plugins/testvendor/goto/Plugin.php .
|
|
./vendor/bin/phpunit
|