-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from RonasIT/dpankratov/actions-configure
Create laravel.yml
- Loading branch information
Showing
45 changed files
with
1,341 additions
and
24 deletions.
There are no files selected for viewing
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,26 @@ | ||
name: Run tests with coverage | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
tests-with-coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.3' | ||
- uses: actions/checkout@v3 | ||
- name: Install Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Execute unit tests via PHPUnit with coverage | ||
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml | ||
- name: Upload coverage results to Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
composer global require php-coveralls/php-coveralls | ||
php-coveralls --coverage_clover=build/logs/clover.xml -v |
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
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,5 @@ | ||
FROM webdevops/php-nginx-dev:7.3 | ||
|
||
RUN wget -O "/usr/local/bin/go-replace" "https://github.com/webdevops/goreplace/releases/download/1.1.2/gr-arm64-linux" \ | ||
&& chmod +x "/usr/local/bin/go-replace" \ | ||
&& "/usr/local/bin/go-replace" --version |
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,34 @@ | ||
<?php | ||
|
||
define('LARAVEL_START', microtime(true)); | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Register The Composer Auto Loader | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Composer provides a convenient, automatically generated class loader | ||
| for our application. We just need to utilize it! We'll require it | ||
| into the script here so that we do not have to worry about the | ||
| loading of any our classes "manually". Feels great to relax. | ||
| | ||
*/ | ||
|
||
require __DIR__.'/../vendor/autoload.php'; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Include The Compiled Class File | ||
|-------------------------------------------------------------------------- | ||
| | ||
| To dramatically increase your application's performance, you may use a | ||
| compiled class file which contains all of the classes commonly used | ||
| by a request. The Artisan "optimize" is used to create this file. | ||
| | ||
*/ | ||
|
||
$compiledPath = __DIR__.'/cache/compiled.php'; | ||
|
||
if (file_exists($compiledPath)) { | ||
require $compiledPath; | ||
} |
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
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
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,11 @@ | ||
version: '3' | ||
|
||
services: | ||
nginx: | ||
build: . | ||
working_dir: /app | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
volumes: | ||
- ./:/app |
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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
<exclude> | ||
<file>./app/Http/routes.php</file> | ||
</exclude> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Application Test Suite"> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<env name="APP_ENV" value="testing"/> | ||
<env name="CACHE_DRIVER" value="array"/> | ||
<env name="SESSION_DRIVER" value="array"/> | ||
<env name="QUEUE_DRIVER" value="sync"/> | ||
</php> | ||
</phpunit> |
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
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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
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
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,2 @@ | ||
* | ||
!.gitignore |
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,72 @@ | ||
<?php | ||
|
||
namespace RonasIT\Support\Tests; | ||
|
||
use RonasIT\Support\AutoDoc\Drivers\LocalDriver; | ||
use Illuminate\Contracts\Filesystem\FileNotFoundException; | ||
use RonasIT\Support\AutoDoc\Exceptions\MissedProductionFilePathException; | ||
|
||
class LocalDriverTest extends TestCase | ||
{ | ||
protected $tmpData; | ||
protected $localDriverClass; | ||
protected $productionFilePath; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->tmpData = $this->getJsonFixture('tmp_data'); | ||
$this->productionFilePath = __DIR__ . '/../storage/documentation.json'; | ||
|
||
config(['auto-doc.drivers.local.production_path' => $this->productionFilePath]); | ||
|
||
$this->localDriverClass = new LocalDriver(); | ||
} | ||
|
||
public function testCreateClassConfigEmpty() | ||
{ | ||
$this->expectException(MissedProductionFilePathException::class); | ||
|
||
config(['auto-doc.drivers.local.production_path' => null]); | ||
|
||
new LocalDriver(); | ||
} | ||
|
||
public function testGetAndSaveTmpData() | ||
{ | ||
$this->localDriverClass->saveTmpData($this->tmpData); | ||
|
||
$this->assertEquals($this->tmpData, $this->localDriverClass->getTmpData()); | ||
} | ||
|
||
public function testSaveData() | ||
{ | ||
$this->localDriverClass->saveTmpData($this->tmpData); | ||
|
||
$this->localDriverClass->saveData(); | ||
|
||
$this->assertFileExists($this->productionFilePath); | ||
$this->assertFileEquals($this->generateFixturePath('tmp_data_non_formatted.json'), $this->productionFilePath); | ||
|
||
$this->assertEquals([], $this->localDriverClass->getTmpData()); | ||
} | ||
|
||
public function testGetDocumentation() | ||
{ | ||
file_put_contents($this->productionFilePath, json_encode($this->tmpData)); | ||
|
||
$documentation = $this->localDriverClass->getDocumentation(); | ||
|
||
$this->assertEquals($this->getJsonFixture('tmp_data'), $documentation); | ||
} | ||
|
||
public function testGetDocumentationFileNotExists() | ||
{ | ||
$this->expectException(FileNotFoundException::class); | ||
|
||
config(['auto-doc.drivers.local.production_path' => 'not_exists_file']); | ||
|
||
(new LocalDriver())->getDocumentation(); | ||
} | ||
} |
Oops, something went wrong.