From f240dabbecb2dc5c83e59d49229c20642d752ce7 Mon Sep 17 00:00:00 2001 From: Vincent <407859+vincentchalamon@users.noreply.github.com> Date: Tue, 6 Jun 2023 10:34:33 +0200 Subject: [PATCH] chore: fix CI (#133) --- .github/dependabot.yml | 8 ++++++++ .github/workflows/ci.yml | 22 +++++++++++----------- features/bootstrap.php | 2 +- tests/ProphecyTrait.php | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1491781 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 + +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66da7b5..ddaa6fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,10 @@ on: - main - '[0-9].x' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: tests: name: Tests PHP ${{ matrix.php }} (Symfony ${{ matrix.symfony }}) @@ -17,28 +21,23 @@ jobs: strategy: matrix: php: - - '7.4' - '8.0' - '8.1' + - '8.2' symfony: - '4.4.*' - '5.4.*' - - '6.1.*' + - '6.3.*' include: - - php: '7.4' - symfony: '5.4.*' - bootable: true - - php: '8.1' - symfony: '6.1.*' + - php: '8.2' + symfony: '6.3.*' coverage: '--coverage-clover build/logs/phpunit/clover.xml' bootable: true quality: true exclude: - # Symfony 6.1 requires PHP 8.1 - - php: '7.4' - symfony: '6.1.*' + # Symfony 6.3 requires PHP 8.1 - php: '8.0' - symfony: '6.1.*' + symfony: '6.3.*' fail-fast: false steps: - name: Checkout @@ -54,6 +53,7 @@ jobs: - name: Install chromium run: | sudo apt-get update + sudo apt-get --fix-broken install sudo apt-get install -y --no-install-recommends chromium-browser - name: Get Composer Cache Directory diff --git a/features/bootstrap.php b/features/bootstrap.php index 274d564..6a05ebb 100644 --- a/features/bootstrap.php +++ b/features/bootstrap.php @@ -31,7 +31,7 @@ // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) if (is_array($env = @include __DIR__.'/.env.local.php')) { foreach ($env as $k => $v) { - $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v); + $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && !str_starts_with($k, 'HTTP_') ? $_SERVER[$k] : $v); } } else { // load all the .env files diff --git a/tests/ProphecyTrait.php b/tests/ProphecyTrait.php index 20c20a8..ec6ecbb 100644 --- a/tests/ProphecyTrait.php +++ b/tests/ProphecyTrait.php @@ -49,7 +49,7 @@ trait ProphecyTrait * * @psalm-param class-string|null $classOrInterface */ - protected function prophesize(?string $classOrInterface = null): ObjectProphecy + protected function prophesize(string $classOrInterface = null): ObjectProphecy { if (\is_string($classOrInterface)) { \assert($this instanceof TestCase);