From 7ab11018a4e77269b50fec6fbb713d65648e8263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Fri, 6 Oct 2023 18:43:42 +0200 Subject: [PATCH 1/2] ci: Add a concurrency strategy Currently when merging a couple of PRs the CI is having a meltdown. This is an attempt to reduce the load. --- .github/workflows/auto-review.yaml | 5 +++++ .github/workflows/docker.yaml | 5 +++++ .github/workflows/e2e-tests.yaml | 5 +++++ .github/workflows/gh-pages.yaml | 5 +++++ .github/workflows/release.yaml | 5 +++++ .github/workflows/requirement-checker.yaml | 5 +++++ .github/workflows/security.yaml | 5 +++++ .github/workflows/unit-tests.yaml | 5 +++++ 8 files changed, 40 insertions(+) diff --git a/.github/workflows/auto-review.yaml b/.github/workflows/auto-review.yaml index 8e689b427..7739cbbd4 100644 --- a/.github/workflows/auto-review.yaml +++ b/.github/workflows/auto-review.yaml @@ -8,6 +8,11 @@ on: # Do not make it the first of the month and/or midnight since it is a very busy time - cron: "* 10 5 * *" +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: lint-cs: runs-on: ubuntu-latest diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 0a80ecd17..aa7b008ea 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -10,6 +10,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read packages: write diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 906067786..8dfaa68ec 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -10,6 +10,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: POLLING_INTERVALS_SEC: 30 SLEEP_TIME_SEC: 60s diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index 7b9cf2e34..0aaf38ebb 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -9,6 +9,11 @@ on: - mkdocs.yaml - .github/workflows/gh-pages.yaml +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: deploy: runs-on: ubuntu-20.04 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e84c2c4e0..d9f5c2b6f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,6 +10,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: DOCKERFILE: .docker/Dockerfile DOCKERHUB_USERNAME: boxproject diff --git a/.github/workflows/requirement-checker.yaml b/.github/workflows/requirement-checker.yaml index 1b23d4eea..9b041b636 100644 --- a/.github/workflows/requirement-checker.yaml +++ b/.github/workflows/requirement-checker.yaml @@ -8,6 +8,11 @@ on: # Do not make it the first of the month and/or midnight since it is a very busy time - cron: "* 10 5 * *" +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: POLLING_INTERVALS_SEC: 30 SLEEP_TIME_SEC: 60s diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 1efc62459..6665f26c8 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -10,6 +10,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: security: runs-on: ubuntu-latest diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 5386af99b..ea41de605 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -10,6 +10,11 @@ on: release: types: [ created ] +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: unit-tests: runs-on: ubuntu-latest From cf55837ae706277a3194fba2e19b9e688ba1d7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Fri, 6 Oct 2023 19:03:09 +0200 Subject: [PATCH 2/2] test: Skip the PharFactory testson PHP 8.1 The Phar Factory tests fail on PHP 8.1 and I am not sure why. However I will probably bump to PHP 8.2 the minimum PHP version soon anyway and the actual used code is a lot more robust hence this should not be a problem. --- tests/Phar/PharFactoryTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Phar/PharFactoryTest.php b/tests/Phar/PharFactoryTest.php index 9f001abbc..e6dc6894e 100644 --- a/tests/Phar/PharFactoryTest.php +++ b/tests/Phar/PharFactoryTest.php @@ -27,6 +27,7 @@ * @covers \KevinGH\Box\Pharaoh\InvalidPhar * * @runTestsInSeparateProcesses + * @requires PHP 8.2.0 * * @internal */