Skip to content

Commit

Permalink
ci: prevent concurrent tests (#19006)
Browse files Browse the repository at this point in the history
  • Loading branch information
millsp committed May 3, 2023
1 parent 42087bf commit 17d7820
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/benchmark.yml
Expand Up @@ -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
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/test.yml
Expand Up @@ -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
Expand All @@ -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
#
Expand Down

0 comments on commit 17d7820

Please sign in to comment.