-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'winter/main' into duplicate-page
- Loading branch information
Showing
39 changed files
with
1,466 additions
and
555 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
phpUnitTests: | ||
runs-on: ubuntu-latest | ||
name: Unit Tests / PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterRelease }} | ||
strategy: | ||
max-parallel: 6 | ||
matrix: | ||
phpVersion: ['8.0', '8.1'] | ||
winterRelease: ['develop'] | ||
winterReleaseDir: ['develop'] | ||
include: | ||
- phpVersion: '7.4' | ||
winterRelease: 'v1.1.9' | ||
winterReleaseDir: '1.1.9' | ||
fail-fast: false | ||
env: | ||
phpExtensions: mbstring, intl, gd, xml, sqlite | ||
cacheKey: ext-cache-v1 | ||
winterCmsRelease: develop | ||
steps: | ||
- name: Checkout changes | ||
uses: actions/checkout@v2 | ||
with: | ||
path: pages-plugin | ||
|
||
- name: Setup cache environment | ||
id: extcache | ||
uses: shivammathur/cache-extensions@v1 | ||
with: | ||
php-version: ${{ matrix.phpVersion }} | ||
extensions: ${{ env.phpExtensions }} | ||
key: ${{ env.cacheKey }} | ||
|
||
- 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 and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.phpVersion }} | ||
extensions: ${{ env.phpExtensions }} | ||
|
||
- name: Install Winter CMS | ||
run: | | ||
wget https://github.com/wintercms/winter/archive/${{ matrix.winterRelease }}.zip | ||
unzip ${{ matrix.winterRelease }}.zip | ||
rm ${{ matrix.winterRelease }}.zip | ||
shopt -s dotglob | ||
mv winter-${{ matrix.winterReleaseDir }}/* ./ | ||
rmdir winter-${{ matrix.winterReleaseDir }} | ||
shopt -u dotglob | ||
cp config/cms.php config/testing/cms.php | ||
mkdir -p plugins/winter | ||
mv pages-plugin plugins/winter/pages | ||
- name: Get Composer cache directory | ||
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-suggest | ||
|
||
- name: Run linting | ||
run: ./vendor/bin/parallel-lint plugins/winter/pages | ||
|
||
- name: Run unit tests (1.2/develop) | ||
if: matrix.winterRelease != 'v1.1.9' | ||
run: php artisan winter:test -p Winter.Pages | ||
|
||
- name: Run unit tests (1.1) | ||
if: matrix.winterRelease == 'v1.1.9' | ||
working-directory: plugins/winter/pages | ||
run: ../../../vendor/bin/phpunit --bootstrap ../../../tests/bootstrap.php |
Oops, something went wrong.