Skip to content

Commit b654138

Browse files
committed
ci: Move update-dp job to build.yml workflow
When pushing to the main branch, we currently trigger a job that waits for 45 minutes - to give time to the build.yml to build and push the new container images - before trying to bump the dpdk-sys reference in the dataplane repository. Instead, it makes more sense to move this job to the build.yml workflow, so that it can start right after the "run" job has successfully completed. This avoids creating a job that sleeps for 45 minutes, and remove the risk that after these 45 minutes the new images are not ready anyway (if the "run" job took longer than that, which occasionally occurs, or if it failed). Signed-off-by: Quentin Monnet <qmo@qmon.net>
1 parent d1be234 commit b654138

File tree

2 files changed

+73
-87
lines changed

2 files changed

+73
-87
lines changed

.github/workflows/build.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
debug_enabled:
1111
type: "boolean"
1212
description: "Run the build with tmate debugging enabled"
13+
bump_dataplane:
14+
type: "boolean"
15+
description: "Run the dataplane bump job after build (only on main branch)"
1316
merge_group:
1417
push:
1518
branches:
@@ -374,3 +377,73 @@ jobs:
374377
body: |
375378
This is an automated Pull Request created by GitHub Actions workflow,
376379
in the frr repository.
380+
381+
# Automatically open a Pull Request in dataplane repository on dpdk-sys updates
382+
bump-dp:
383+
name: "Bump dpdk-sys reference in dataplane repository"
384+
runs-on: "ubuntu-latest"
385+
# Run only when pushing to main branch (or on manual dispatch using the main branch)
386+
if: >-
387+
(
388+
github.event_name == 'push'
389+
|| github.event_name == 'workflow_dispatch' && inputs.bump_dataplane
390+
) && github.ref == 'refs/heads/main'
391+
needs:
392+
- run
393+
permissions:
394+
contents: "read"
395+
packages: "read"
396+
id-token: "write"
397+
398+
steps:
399+
- name: "Install dependencies"
400+
run: |
401+
sudo apt-get update
402+
# Install 'envsubst', used in bump.sh
403+
sudo apt-get install --yes --no-install-recommends gettext
404+
405+
- name: "Checkout dataplane repository"
406+
uses: "actions/checkout@v6"
407+
with:
408+
repository: "githedgehog/dataplane"
409+
410+
- name: "Bump dpdk-sys reference"
411+
run: |
412+
./scripts/bump.sh
413+
414+
- name: "Generate GitHub App token for the dataplane repository"
415+
id: "app-token"
416+
uses: "actions/create-github-app-token@v2"
417+
with:
418+
app-id: "${{ secrets.DP_APP_ID }}"
419+
private-key: "${{ secrets.DP_PRIVATE_KEY }}"
420+
repositories: "dataplane"
421+
422+
- name: "Create Pull Request in dataplane repository"
423+
uses: "peter-evans/create-pull-request@v8"
424+
with:
425+
token: "${{ steps.app-token.outputs.token }}"
426+
branch: "bump/dpdk-sys"
427+
title: "bump(dpdk-sys): new-version"
428+
labels: |
429+
automated
430+
dependencies
431+
signoff: "true"
432+
commit-message: |
433+
bump(dpdk-sys): automated bump of dpdk-sys
434+
435+
Automated bump from dpdk-sys,
436+
triggered by push to 'main' in source repository.
437+
438+
Commit: githedgehog/dpdk-sys@${{ github.sha }}
439+
sign-commits: "true"
440+
body: |
441+
Automated bump from dpdk-sys
442+
Commit: githedgehog/dpdk-sys@${{ github.sha }}
443+
444+
- name: "Setup tmate session for debug"
445+
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
446+
uses: "mxschmitt/action-tmate@v3"
447+
timeout-minutes: 60
448+
with:
449+
limit-access-to-actor: true

.github/workflows/update-dp.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)