Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx committed Mar 15, 2024
1 parent f185b8a commit 4c86d1a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- run: |
set -ex
docker compose up -d
docker compose stop -d
docker compose stop
no-ansi:
runs-on: ubuntu-latest

Expand All @@ -30,4 +30,37 @@ jobs:
- run: |
set -ex
docker compose --ansi=never up -d
docker compose --ansi=never stop -d
docker compose --ansi=never stop
castor-ansi:
runs-on: ubuntu-latest

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 ansi
castor-no-ansi:
runs-on: ubuntu-latest

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 no-ansi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.castor.stub.php
19 changes: 19 additions & 0 deletions castor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Castor\Attribute\AsTask;

use function Castor\run;

#[AsTask()]
function ansi()
{
run(['docker', 'compose', 'up', '-d']);
run(['docker', 'compose', 'stop']);
}

#[AsTask()]
function no_ansi()
{
run(['docker', 'compose', '--ansi=never', 'up', '-d']);
run(['docker', 'compose', '--ansi=never', 'stop']);
}

0 comments on commit 4c86d1a

Please sign in to comment.