Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Feb 7, 2023
1 parent c5b31ae commit c483168
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/canvas.yaml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit9.xml export-ignore
/phpunit.xml export-ignore
/pint.json export-ignore
/sync.sh export-ignore
Expand Down
66 changes: 64 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,74 @@ jobs:
- name: Start Chrome Driver
run: vendor/laravel/dusk/bin/chromedriver-linux &

- name: Execute tests (with deprecations)
run: vendor/bin/phpunit
- name: Execute tests
run: vendor/bin/phpunit -c phpunit9.xml

- name: Upload Failed Screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: tests/Browser/screenshots/*

tests-on-phpunit-10:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- "ubuntu-latest"
php:
- 8.1
- 8.2
phpunit:
- "10.x"
dependencies:
- "highest"
- "lowest"
experimental:
- false

name: PHP${{ matrix.php }} with PHPUnit${{ matrix.phpunit }} on ${{ matrix.os }} (${{ matrix.dependencies }})

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install PHPUnit ${{ matrix.phpunit }}
run: |
composer require "phpunit/phpunit:${{ matrix.phpunit }}" --dev --no-interaction --no-update
- name: Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --no-cache"

- name: Installed dependencies
run: |
composer show -D
- name: Create database
run: php ./create-sqlite-db

- name: Start Chrome Driver
run: vendor/laravel/dusk/bin/chromedriver-linux &

- name: Execute tests
run: vendor/bin/phpunit -c phpunit.xml

- name: Upload Failed Screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: tests/Browser/screenshots/*

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
/vendor/*

# Testbench Dusk

/src/tests/Browser/console/*
/src/tests/Browser/screenshots/*
/tests/Browser/console/*
/tests/Browser/screenshots/*
/tmp/*

# PHPUnit
/coverage/*
/.phpunit.cache/*
/.phpunit.result.cache

# Laravel Stubs
/laravel/vendor
29 changes: 29 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
processIsolation="false"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<coverage includeUncoveredFiles="false">
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Browser">
<directory suffix="Test.php">./tests/Browser</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="DB_CONNECTION" value="sqlite"/>
</php>
</phpunit>
32 changes: 0 additions & 32 deletions phpunit.xml.dist

This file was deleted.

32 changes: 32 additions & 0 deletions phpunit9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<coverage includeUncoveredFiles="false">
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Browser">
<directory suffix="Test.php">./tests/Browser</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="DB_CONNECTION" value="sqlite"/>
</php>
</phpunit>

0 comments on commit c483168

Please sign in to comment.