From 17d7820d2071c2e497a7e694d3279c86f919075a Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 3 May 2023 10:01:17 -1000 Subject: [PATCH] ci: prevent concurrent tests (#19006) --- .github/workflows/benchmark.yml | 4 ++++ .github/workflows/test.yml | 18 +++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 58f21e1bff92..61b2326db4eb 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -37,6 +37,10 @@ on: env: PRISMA_TELEMETRY_INFORMATION: 'prisma benchmark.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: benchmark: name: all diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93d458229017..ca6befd4c7a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,6 +53,11 @@ env: # To hide "Update available 0.0.0 -> x.x.x" PRISMA_HIDE_UPDATE_MESSAGE: true +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + # Don't cancel if it's on schedule (used for BuildPulse for flaky tests detection) + cancel-in-progress: ${{ github.event_name != 'schedule' }} + jobs: detect_jobs_to_run: name: Detect jobs to run @@ -70,19 +75,6 @@ jobs: - id: detect run: ./.github/workflows/scripts/detect-jobs-to-run.js <<< '${{ steps.files.outputs.all }}' - # From https://github.com/marketplace/actions/skip-duplicate-actions - # This action cleans up previously running instances of a workflow on the same branch. - # This accomplishes the task of automatically cancelling CI runs on pushes to the same branch, - # which is a common feature in most CI systems but currently not possible with GitHub actions. - cleanup-runs: - continue-on-error: true - runs-on: ubuntu-latest - if: "!startsWith(github.ref, 'refs/tags/') && !contains(github.actor, 'renovate') && github.event_name != 'schedule'" - steps: - - uses: fkirc/skip-duplicate-actions@v5 - with: - cancel_others: 'true' - # # Linting #