Skip to content

Commit 4c9a0e3

Browse files
authored
Add concurrency groups to all PR-triggered workflows (branch_9x) (#4319)
1 parent 84d071f commit 4c9a0e3

7 files changed

Lines changed: 41 additions & 7 deletions

File tree

.github/workflows/bin-solr-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
- 'solr/core/src/java/org/apache/solr/cli/**'
1212
- 'solr/prometheus-exporter/**'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
test:
1620
name: Run Solr Script Tests

.github/workflows/docker-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- 'solr/docker/**'
1111
- 'solr/packaging/**'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
test:
1519
name: Build and test Docker image

.github/workflows/gradle-extraction-check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
paths:
99
- 'solr/modules/extraction/**'
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
test:
1317
name: extraction module tests with docker

.github/workflows/gradle-precommit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- '*'
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
test:
1014
name: gradle check

.github/workflows/solrj-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- '.github/workflows/solrj-test.yml'
99
- 'solr/solrj/**'
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
test:
1317
name: Run SolrJ Tests

.github/workflows/tests-via-crave.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,41 @@ on:
55
branches:
66
- '*'
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
test:
1014
name: Run Solr Tests using Crave.io resources
1115

1216
runs-on: self-hosted
1317
timeout-minutes: 40
1418

19+
env:
20+
# Use a PR-scoped workspace path so that each new run for the same PR
21+
# destroys any leftover resources from a previous run (including cancelled
22+
# runs whose cleanup step may not have completed in time).
23+
CRAVE_WORKSPACE: /crave-devspaces/pipeline/prs/${{ github.event.pull_request.number }}
24+
1525
steps:
1626
- name: Destroy previous clone
17-
run: crave clone destroy -y /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER} || echo "Clone did not exist"
27+
run: crave clone destroy -y ${CRAVE_WORKSPACE} || echo "Clone did not exist"
1828
continue-on-error: true
1929
- name: Crave clone sources
20-
run: crave clone create --projectID 39 /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
30+
run: crave clone create --projectID 39 ${CRAVE_WORKSPACE}
2131
- name: Checkout the correct branch
2232
run: |
23-
git -C /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER} fetch origin ${GITHUB_REF}:${GITHUB_REF}
24-
git -C /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER} checkout ${GITHUB_REF}
33+
git -C ${CRAVE_WORKSPACE} fetch origin ${GITHUB_REF}:${GITHUB_REF}
34+
git -C ${CRAVE_WORKSPACE} checkout ${GITHUB_REF}
2535
- name: Initialize, build, test
2636
run: |
27-
cd /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
37+
cd ${CRAVE_WORKSPACE}
2838
crave run --clean --message "PR: ${GITHUB_REF_NAME}" -- ./gradlew --console=plain test
2939
- name: Cleanup
3040
if: ${{ always() }}
3141
run: |
32-
pushd /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
42+
pushd ${CRAVE_WORKSPACE}
3343
crave stop --all
3444
popd
35-
crave clone destroy -y /crave-devspaces/pipeline/runs/${GITHUB_RUN_ID}_${GITHUB_RUN_NUMBER}
45+
crave clone destroy -y ${CRAVE_WORKSPACE}

.github/workflows/validate-changelog.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- '*'
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
validate-changelog:
1014
name: Check changelog entry

0 commit comments

Comments
 (0)