diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 354c4752..f9d3660e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,11 @@ jobs: with: test-group: unit + cli-tests: + uses: './.github/workflows/ci-tests.yml' + with: + test-group: cli + openswoole-api-tests: uses: './.github/workflows/ci-tests.yml' with: @@ -50,11 +55,6 @@ jobs: - run: ./vendor/bin/rr get --no-interaction --location bin/ && chmod +x bin/rr - run: composer test:api:rr - cli-tests: - uses: './.github/workflows/ci-tests.yml' - with: - test-group: cli - sqlite-db-tests: uses: './.github/workflows/ci-db-tests.yml' with: diff --git a/config/config.php b/config/config.php index 088cad0a..4f4a1359 100644 --- a/config/config.php +++ b/config/config.php @@ -13,11 +13,12 @@ use Shlinkio\Shlink\Config\ConfigAggregator\EnvVarLoaderProvider; use function class_exists; use function Shlinkio\Shlink\Config\env; -use function Shlinkio\Shlink\Config\runningInOpenswoole; use function Shlinkio\Shlink\Config\runningInRoadRunner; +use const PHP_SAPI; + $isTestEnv = env('APP_ENV') === 'test'; -$enableSwoole = ! runningInRoadRunner() && runningInOpenswoole(); +$enableSwoole = PHP_SAPI === 'cli' && ! runningInRoadRunner(); return (new ConfigAggregator\ConfigAggregator([ ! $isTestEnv