From 40b8c7783ff393da0601b4eee7213fdd2728708e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 13 Sep 2024 08:51:54 +0200 Subject: [PATCH 1/4] .github/workflows/schedule-builds: Run scheduled jobs via workflow_dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently only test the master branch on a regular schedule and not the different release branches (like e.g. scarthgap). Also testing these other branches is complicated by the following detail in the GitHub action documentation[1]: > Scheduled workflows will only run on the default branch This means we need some sort of workaround to run scheduled jobs on different branches. This commit adds a scheduled job on the master branch to trigger jobs on other branches via the `workflow_dispatch` event. [1]: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule Signed-off-by: Leonard Göhrs --- .github/workflows/build.yml | 3 --- .github/workflows/schedule-builds.yml | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/schedule-builds.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97fc064..2da991a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,9 +5,6 @@ on: pull_request: {} # allow rebuilding without a push workflow_dispatch: {} - # pre-build sstate regularly - schedule: - - cron: '30 2 * * *' jobs: build: diff --git a/.github/workflows/schedule-builds.yml b/.github/workflows/schedule-builds.yml new file mode 100644 index 0000000..c4f0d57 --- /dev/null +++ b/.github/workflows/schedule-builds.yml @@ -0,0 +1,21 @@ +name: Schedule Builds + +on: + # allow rebuilding manually + workflow_dispatch: + # pre-build sstate regularly + schedule: + - cron: '30 2 * * *' + +jobs: + build: + name: Schedule Builds + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Check out the repository + uses: actions/checkout@v4 + + - name: Trigger master build + run: gh workflow run build --ref master From 4e88a57bc9fb01ad05d0d66af3e1f12e159683c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 13 Sep 2024 09:24:17 +0200 Subject: [PATCH 2/4] .github/workflows/schedule-builds: Also build the scarthgap branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scarthgap is the most recent yocto release. Scarthgap will also be a LTS release that is supported until April 2028. Signed-off-by: Leonard Göhrs --- .github/workflows/schedule-builds.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/schedule-builds.yml b/.github/workflows/schedule-builds.yml index c4f0d57..dc95e09 100644 --- a/.github/workflows/schedule-builds.yml +++ b/.github/workflows/schedule-builds.yml @@ -19,3 +19,6 @@ jobs: - name: Trigger master build run: gh workflow run build --ref master + + - name: Trigger scarthgap build + run: gh workflow run build --ref scarthgap From f4d9d396d8e7dddc098b91a571a466538732e7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 13 Sep 2024 09:25:15 +0200 Subject: [PATCH 3/4] .github/workflows/schedule-builds: Also build the kirkstone branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kirkstone is a yocto LTS release that is supported until April 2026. Signed-off-by: Leonard Göhrs --- .github/workflows/schedule-builds.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/schedule-builds.yml b/.github/workflows/schedule-builds.yml index dc95e09..1cf24f4 100644 --- a/.github/workflows/schedule-builds.yml +++ b/.github/workflows/schedule-builds.yml @@ -22,3 +22,6 @@ jobs: - name: Trigger scarthgap build run: gh workflow run build --ref scarthgap + + - name: Trigger kirkstone build + run: gh workflow run build --ref kirkstone From d0571c895be7b95594700c3b1a9b300677423beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Fri, 13 Sep 2024 09:18:13 +0200 Subject: [PATCH 4/4] .github/workflows/schedule-builds: opt-in to scheduled runs via variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not anyone who creates a fork of the project may want to run jobs on a schedule. Gate scheduled runs via a GitHub action variable. Manual triggering of the job via workflow_dispatch is not affected by the variable. Signed-off-by: Leonard Göhrs --- .github/workflows/schedule-builds.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/schedule-builds.yml b/.github/workflows/schedule-builds.yml index 1cf24f4..4410958 100644 --- a/.github/workflows/schedule-builds.yml +++ b/.github/workflows/schedule-builds.yml @@ -11,6 +11,7 @@ jobs: build: name: Schedule Builds runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' || vars.SCHEDULE_BUILDS }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: