Skip to content

Commit

Permalink
Update testing process
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Jul 18, 2022
1 parent 1bf4af0 commit 5cda479
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ on:
jobs:
phpUnitTests:
runs-on: ubuntu-latest
name: Unit Tests / PHP ${{ matrix.phpVersions }}
name: Unit Tests / PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterRelease }}
strategy:
max-parallel: 6
matrix:
phpVersions: ['7.2', '7.3', '7.4', '8.0']
phpVersion: ['8.0', '8.1']
winterRelease: ['develop']
include:
- phpVersion: '7.2'
winterRelease: 'v1.1.9'
- phpVersion: '7.3'
winterRelease: 'v1.1.9'
- phpVersion: '7.4'
winterRelease: 'v1.1.9'
fail-fast: false
env:
phpExtensions: mbstring, intl, gd, xml, sqlite
Expand All @@ -29,7 +37,7 @@ jobs:
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.phpVersions }}
php-version: ${{ matrix.phpVersion }}
extensions: ${{ env.phpExtensions }}
key: ${{ env.cacheKey }}

Expand All @@ -43,19 +51,19 @@ jobs:
- name: Install PHP and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.phpVersions }}
php-version: ${{ matrix.phpVersion }}
extensions: ${{ env.phpExtensions }}
tools: composer:v2
coverage: none

- name: Install Winter CMS
run: |
wget https://github.com/wintercms/winter/archive/${{ env.winterCmsRelease }}.zip
unzip ${{ env.winterCmsRelease }}.zip
rm ${{ env.winterCmsRelease }}.zip
wget https://github.com/wintercms/winter/archive/${{ matrix.winterRelease }}.zip
unzip ${{ matrix.winterRelease }}.zip
rm ${{ matrix.winterRelease }}.zip
shopt -s dotglob
mv winter-${{ env.winterCmsRelease }}/* ./
rmdir winter-${{ env.winterCmsRelease }}
mv winter-${{ matrix.winterRelease }}/* ./
rmdir winter-${{ matrix.winterRelease }}
shopt -u dotglob
cp config/cms.php config/testing/cms.php
mkdir -p plugins/winter
Expand All @@ -79,6 +87,4 @@ jobs:
run: ./vendor/bin/parallel-lint plugins/winter/user

- name: Run unit tests
run: |
cd plugins/winter/user
../../../vendor/bin/phpunit
run: php artisan winter:test -p Winter.User
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
composer.lock
vendor
vendor
.DS_Store
6 changes: 0 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="../../../tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
Expand All @@ -15,11 +14,6 @@
<directory>./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./classes</directory>
Expand Down

0 comments on commit 5cda479

Please sign in to comment.