From 83405b160b5f3c01a5c56cdc2150598824c9df6a Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 18 Aug 2023 21:00:59 -0700 Subject: [PATCH] Do full run of "Arduino IDE" workflow on tag push The project was recently switched to using a "trunk-based" development strategy. This necessitated some adjustments to the configuration of the GitHub Actions workflows in order to ensure the CI system could be used to effectively validate the project at the state staged for release in the release branch. A `run-determination` job was added to the workflow. This job determines whether the conditions under which the workflow was triggered indicate that the rest of the jobs in the workflow should be run. A validation workflow should run fully under any of the following conditions: - The trigger event was something other than a branch creation - The trigger event was a release branch creation Since the project is fully validated prior to a release, running the workflow when triggered by a release tag is pointless (and even harmful in some specific standardized workflows not currently used in this repository), so (even if for no other reason than efficiency) verification workflows are configured to not run under these conditions. The standardized Arduino tooling workflows follow a modular design where each workflow has a narrow scope of purpose. That path was not taken by those who set up the infrastructure for this repository. They instead created a single massive monolithic "Arduino IDE" workflow that performs many unrelated operations under various conditions. This workflow generates releases in addition to doing validation. Even though it is pointless to run the workflow's validation operations when the workflow is triggered by a release tag, it is essential to run it for the release generation. Previously, the code used in the "Arduino IDE" workflow's `run-determination` job was configured as appropriate for a verification workflow. This meant that a release would not be generated on push of a release tag as intended. The bug is fixed by adjusting the code to do a full run of the workflow when triggered by a release tag. --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5977a986..1c830648d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,12 +46,10 @@ jobs: id: determination run: | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" - TAG_REGEX="refs/tags/.*" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ - ("${{ github.event_name }}" != "create" || - "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX) && - ! "${{ github.ref }}" =~ $TAG_REGEX + "${{ github.event_name }}" != "create" || + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ]]; then # Run the other jobs. RESULT="true"