-
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
0 parents
commit 7a9860d
Showing
4 changed files
with
140 additions
and
0 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,39 @@ | ||
name: CI | ||
|
||
"on": | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
castor: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
cmd: | ||
- ansi-raw | ||
- ansi-false-false | ||
- ansi-false-true | ||
- ansi-true-false | ||
- no-ansi-raw | ||
- no-ansi-false-false | ||
- no-ansi-false-true | ||
- no-ansi-true-false | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
tools: castor | ||
|
||
- run: | | ||
set -ex | ||
castor debug | ||
castor ${{ matrix.cmd }} |
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 @@ | ||
/.castor.stub.php |
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,87 @@ | ||
<?php | ||
|
||
use Castor\Attribute\AsTask; | ||
use Castor\Context; | ||
|
||
use function Castor\run; | ||
|
||
#[AsTask()] | ||
function ansi_raw() | ||
{ | ||
`docker compose --ansi=always up -d`; | ||
`docker compose --ansi=always stop`; | ||
} | ||
|
||
#[AsTask()] | ||
function ansi_false_false() | ||
{ | ||
$c = new Context( | ||
pty: false, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', '--ansi=always', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=always', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function ansi_true_false() | ||
{ | ||
$c = new Context( | ||
pty: true, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', '--ansi=always', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=always', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function ansi_false_true() | ||
{ | ||
$c = new Context( | ||
pty: false, | ||
tty: true, | ||
); | ||
run(['docker', 'compose', '--ansi=always', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=always', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function no_ansi_raw() | ||
{ | ||
`docker compose --ansi=never up -d`; | ||
`docker compose --ansi=never stop`; | ||
} | ||
|
||
|
||
#[AsTask()] | ||
function no_ansi_false_false() | ||
{ | ||
$c = new Context( | ||
pty: false, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', '--ansi=never', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=never', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function no_ansi_true_false() | ||
{ | ||
$c = new Context( | ||
pty: true, | ||
tty: false, | ||
); | ||
run(['docker', 'compose', '--ansi=never', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=never', 'stop'], context: $c); | ||
} | ||
|
||
#[AsTask()] | ||
function no_ansi_false_true() | ||
{ | ||
$c = new Context( | ||
pty: false, | ||
tty: true, | ||
); | ||
run(['docker', 'compose', '--ansi=never', 'up', '-d'], context: $c); | ||
run(['docker', 'compose', '--ansi=never', 'stop'], context: $c); | ||
} |
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,13 @@ | ||
version: "3.7" | ||
|
||
services: | ||
s1: | ||
image: hello-world | ||
s2: | ||
image: hello-world | ||
s3: | ||
image: hello-world | ||
s4: | ||
image: hello-world | ||
s5: | ||
image: hello-world |