Skip to content

Commit 0a860ac

Browse files
committed
update build-and-push.yml
Signed-off-by: Alyssa Goins <agoins@redhat.com>
1 parent afb3812 commit 0a860ac

42 files changed

Lines changed: 320 additions & 73 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/add-ci-passed-label.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- labeled
1212
- unlabeled
1313
workflow_run:
14-
workflows: ["CI Check"]
14+
workflows: [ "CI Check" ]
1515
types:
1616
- completed
1717

@@ -20,8 +20,12 @@ permissions:
2020
issues: write
2121

2222
jobs:
23+
gatekeeper:
24+
uses: ./.github/workflows/wait-for-gatekeeper.yml
25+
2326
fetch_data:
2427
name: Fetch PR eligibility
28+
needs: gatekeeper
2529
runs-on: ubuntu-latest
2630
outputs:
2731
pr_number: ${{ steps.pr.outputs.pr_number }}
@@ -87,6 +91,7 @@ jobs:
8791
8892
reset_ci_passed_label:
8993
name: Reset stale 'ci-passed' label
94+
needs: gatekeeper
9095
runs-on: ubuntu-latest
9196
steps:
9297
- name: Remove existing 'ci-passed' label
@@ -125,7 +130,7 @@ jobs:
125130
add_ci_passed_label:
126131
name: Add 'ci-passed' label
127132
runs-on: ubuntu-latest
128-
needs: fetch_data
133+
needs: [fetch_data,gatekeeper]
129134
steps:
130135
- name: Add 'ci-passed' label
131136
shell: bash

.github/workflows/api-server-tests.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ on:
1717
- main
1818
- stable
1919
- 'rhoai-*'
20-
workflow_run:
21-
id: gatekeeper
22-
workflows: [ "Gatekeeper" ]
23-
types:
24-
- completed
2520

2621
workflow_dispatch:
2722
inputs:
@@ -64,21 +59,11 @@ concurrency:
6459
cancel-in-progress: true
6560

6661
jobs:
67-
cancel-on-gatekeeper-failure:
68-
if: ${{ github.event.gatekeeper.conclusion != 'success' }}
69-
runs-on: ubuntu-latest
70-
steps:
71-
- name: Cancel Workflow
72-
uses: actions/github-script@v6
73-
with:
74-
script: |
75-
github.rest.actions.cancelWorkflowRun({
76-
owner: context.repo.owner,
77-
repo: context.repo.repo,
78-
run_id: context.runId,
79-
})
62+
gatekeeper:
63+
uses: ./.github/workflows/wait-for-gatekeeper.yml
8064

8165
build:
66+
needs: gatekeeper
8267
uses: ./.github/workflows/image-builds.yml
8368

8469
api-test-standalone:
@@ -250,7 +235,6 @@ jobs:
250235
deployment_mode: ${{ steps.deploy.outputs.deployment_mode }}
251236

252237
api-test-multi-user:
253-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
254238
needs: build
255239
runs-on: ubuntu-latest
256240
strategy:

.github/workflows/backend-visualization.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ on:
1616
- '!**/*.md'
1717
- '!**/OWNERS'
1818

19-
20-
2119
jobs:
20+
gatekeeper:
21+
uses: ./.github/workflows/wait-for-gatekeeper.yml
22+
2223
backend-visualization-test:
24+
needs: gatekeeper
2325
runs-on: ubuntu-latest
2426
steps:
2527
- name: Checkout code

.github/workflows/build-master.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
- stable
88
- 'rhoai-*'
9+
910
concurrency:
1011
group: ${{ github.workflow }}
1112
cancel-in-progress: true

.github/workflows/build-prs-trigger.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1616
cancel-in-progress: true
1717
jobs:
18+
gatekeeper:
19+
uses: ./.github/workflows/wait-for-gatekeeper.yml
20+
1821
upload-data:
22+
needs: gatekeeper
1923
runs-on: ubuntu-latest
2024
steps:
2125
- uses: actions/checkout@v2

.github/workflows/build-prs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Build images for PRs
22
on:
33
workflow_run:
4-
workflows: ["Trigger PR CI"]
4+
workflows: [ "Trigger PR CI" ]
55
types:
66
- completed
77
env:
@@ -11,7 +11,11 @@ env:
1111
GH_USER_EMAIL: 140449482+dsp-developers@users.noreply.github.com
1212
GH_USER_NAME: dsp-developers
1313
jobs:
14+
gatekeeper:
15+
uses: ./.github/workflows/wait-for-gatekeeper.yml
16+
1417
fetch-data:
18+
needs: gatekeeper
1519
name: Fetch workflow payload
1620
runs-on: ubuntu-latest
1721
if: >

.github/workflows/build-tools-images.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: Build tools images
22

33
# This workflow is disabled for downstream.
4-
on: []
5-
# push:
6-
# branches:
7-
# - master
8-
# - main
9-
# - stable
10-
# - 'release-*'
11-
# - 'rhoai-*'
12-
# pull_request:
13-
# branches:
14-
# - master
15-
# - 'release-*'
16-
# workflow_dispatch: {}
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
- stable
10+
- 'release-*'
11+
- 'rhoai-*'
12+
pull_request:
13+
branches:
14+
- master
15+
- 'release-*'
16+
workflow_dispatch:
1717

1818
permissions:
1919
contents: read
@@ -29,7 +29,11 @@ concurrency:
2929
cancel-in-progress: false
3030

3131
jobs:
32+
gatekeeper:
33+
uses: ./.github/workflows/wait-for-gatekeeper.yml
34+
3235
build-tools:
36+
needs: gatekeeper
3337
name: Build tools images
3438
runs-on: ubuntu-latest
3539
steps:

.github/workflows/cancel.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Cancel
2+
on: []
3+
# workflow_run:
4+
# id: gatekeeper
5+
# workflows: [ "Gatekeeper" ]
6+
# types:
7+
# - completed
8+
9+
jobs:
10+
cancel:
11+
name: 'Cancel Previous Runs'
12+
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion != 'success' }}
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 3
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
sparse-checkout: .github/workflows
19+
sparse-checkout-cone-mode: false
20+
21+
- name: Build workflow list
22+
id: workflows
23+
run: |
24+
ids=$(ls .github/workflows/ \
25+
| grep -v -e '^cancel\.yml$' -e '^gatekeeper\.yml$' \
26+
| paste -sd ',' -)
27+
echo "ids=$ids" >> "$GITHUB_OUTPUT"
28+
29+
- uses: styfle/cancel-workflow-action
30+
with:
31+
workflow_id: ${{ steps.workflows.outputs.ids }}

.github/workflows/ci-checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ name: CI Check
44
on:
55
pull_request_target:
66
types: [opened, synchronize, reopened, labeled, unlabeled]
7-
workflow_run:
8-
workflows: [ "Stable Merge Integration Test Check" ] # Triggers when "Stable Merge Integration Test Check" succeeds
9-
types: [completed]
10-
branches: [stable]
117

128
jobs:
9+
gatekeeper:
10+
uses: ./.github/workflows/wait-for-gatekeeper.yml
11+
1312
check_ci_status:
13+
needs: gatekeeper
1414
runs-on: ubuntu-latest
1515
permissions:
1616
checks: read

.github/workflows/commit-check-pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ env:
99
GH_USER_EMAIL: 140449482+dsp-developers@users.noreply.github.com
1010
GH_USER_NAME: dsp-developers
1111
jobs:
12+
gatekeeper:
13+
uses: ./.github/workflows/wait-for-gatekeeper.yml
14+
1215
fetch-data:
16+
needs: gatekeeper
1317
name: Fetch workflow payload
1418
runs-on: ubuntu-latest
1519
if: >

0 commit comments

Comments
 (0)