Try using sqlite with filesystem on travis

This commit is contained in:
Bubka 2022-04-04 16:26:32 +02:00
parent 1c9c6f2703
commit 41aedb9d7b
3 changed files with 39 additions and 47 deletions

View File

@ -1,46 +0,0 @@
# name: phpunit
# on:
# push:
# branches:
# - dev
# paths:
# - .github/workflows/phpunit.yml
# - app/**
# - bootstrap/**
# - config/**
# - database/**
# - docker/**
# - public/**
# - resources/**
# - routes/**
# - storage/**
# - tests/**
# - .dockerignore
# - .env.travis
# - artisan
# - composer.json
# - composer.lock
# - Dockerfile
# - phpunit.xml
# - server.php
# jobs:
# tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install dependencies
# uses: php-actions/composer@v6
# with:
# php_version: 7.4
# dev: no
# - name: Run PHPUnit tests
# uses: php-actions/phpunit@v3
# with:
# php_version: 7.4
# version: 9.5
# bootstrap: vendor/autoload.php
# configuration: phpunit.xml

View File

@ -22,9 +22,10 @@ before_script:
script:
# - DATABASE=mysql vendor/bin/phpunit -c phpunit-mysql.xml
- cp .env.travis .env
- touch database/database.sqlite
- php artisan config:clear
- php artisan key:generate
- DATABASE=sqlite vendor/bin/phpunit -c phpunit.xml --coverage-clover=coverage.xml
- DATABASE=sqlite vendor/bin/phpunit -c phpunit-travis-sqlite.xml --coverage-clover=coverage.xml
after_success:
# Submit coverage report to https://codecov.io

37
phpunit-travis-sqlite.xml Normal file
View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
stopOnError="false"
beStrictAboutTestsThatDoNotTestAnything="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="Api.v1">
<directory suffix="Test.php">./tests/Api/v1</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<!-- following values override .env.testing vars -->
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value="./database/database.sqlite"/>
</php>
</phpunit>