-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
18 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
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,30 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- NDybnov/hw21 | ||
|
||
env: | ||
COMMENT: 'my-comment-env' | ||
APP_VERSION: 'v01100600' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image | ||
run: | | ||
docker compose build | ||
docker compose up --detach | ||
- uses: actions/checkout@v3 | ||
- name: Copy .env | ||
run: docker compose exec deploy-php-cli php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
#update values | ||
- name: Install Dependencies | ||
run: docker compose exec deploy-php-cli composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Execute tests (Unit and Feature tests) via PHPUnit | ||
run: docker compose exec deploy-php-cli vendor/phpunit/phpunit/phpunit tests | ||
- name: Test run vie Curl | ||
run: docker compose exec deploy-php-cli curl 0.0.0.0:8000 |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
APP_VERSION=3a4cdb6 | ||
OWN_NGINX_PORT=80 | ||
APP_VERSION=123 | ||
COMMENT='last comment' |
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 |
---|---|---|
@@ -1,22 +1,39 @@ | ||
<?php | ||
|
||
//echo PHP_VERSION_ID; | ||
echo PHP_VERSION; | ||
//echo 123; | ||
// phpinfo(); | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
echo '<br/>'; | ||
print_r($_ENV); | ||
echo '<br/>'; | ||
var_export($_SERVER); | ||
echo '<br/>'; | ||
use NdybnovHw03\CnfRead\ConfigStorage; | ||
|
||
print_r(getenv()); | ||
echo '<br/>'; | ||
|
||
putenv('app_version=c3224e0'); | ||
$config = (new ConfigStorage()) | ||
->fromDotEnvFile([__DIR__, '.env']); | ||
|
||
echo '<br/>'; | ||
$version = $config->get('APP_VERSION'); | ||
$comment = $config->get('COMMENT'); | ||
|
||
print_r(getenv()); | ||
echo '<br/>'; | ||
putenv('app_version=' . $version); | ||
putenv('comment=' . $comment); | ||
|
||
$version = sprintf( | ||
'%s:%s:%s', | ||
PHP_VERSION, | ||
getenv('app_version'), | ||
getenv('comment'), | ||
); | ||
echo $version; | ||
|
||
var_dump($_ENV); | ||
|
||
|
||
function dddddd(): int | ||
{ | ||
return 0; | ||
} | ||
|
||
|
||
class Dd { | ||
public function ddd(): int | ||
{ | ||
return 0; | ||
} | ||
} |
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,12 @@ | ||
<?php | ||
|
||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class DefaultTest extends TestCase | ||
{ | ||
public function testDefault(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
} |