diff --git a/.github/workflows/check-action-metadata-task.yml b/.github/workflows/check-action-metadata-task.yml index 8eca242a..9042a6cf 100644 --- a/.github/workflows/check-action-metadata-task.yml +++ b/.github/workflows/check-action-metadata-task.yml @@ -37,7 +37,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-files-task.yml b/.github/workflows/check-files-task.yml index bb5690ed..f037d2be 100644 --- a/.github/workflows/check-files-task.yml +++ b/.github/workflows/check-files-task.yml @@ -21,7 +21,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-general-formatting-task.yml b/.github/workflows/check-general-formatting-task.yml index 7a19a414..f94b8eb5 100644 --- a/.github/workflows/check-general-formatting-task.yml +++ b/.github/workflows/check-general-formatting-task.yml @@ -21,7 +21,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml index 4492bccc..4930f43c 100644 --- a/.github/workflows/check-license.yml +++ b/.github/workflows/check-license.yml @@ -41,7 +41,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index a2001a8e..e7fc9286 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -47,7 +47,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-npm-task.yml b/.github/workflows/check-npm-task.yml index ba79f745..a688e2d0 100644 --- a/.github/workflows/check-npm-task.yml +++ b/.github/workflows/check-npm-task.yml @@ -38,7 +38,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-prettier-formatting-task.yml b/.github/workflows/check-prettier-formatting-task.yml index d999002f..61442958 100644 --- a/.github/workflows/check-prettier-formatting-task.yml +++ b/.github/workflows/check-prettier-formatting-task.yml @@ -215,7 +215,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-python-task.yml b/.github/workflows/check-python-task.yml index 17a5e72f..4d506953 100644 --- a/.github/workflows/check-python-task.yml +++ b/.github/workflows/check-python-task.yml @@ -41,7 +41,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-taskfiles.yml b/.github/workflows/check-taskfiles.yml index 22edd45b..ad96a93c 100644 --- a/.github/workflows/check-taskfiles.yml +++ b/.github/workflows/check-taskfiles.yml @@ -35,7 +35,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-toc-task.yml b/.github/workflows/check-toc-task.yml index 854f93ef..f5a45f0e 100644 --- a/.github/workflows/check-toc-task.yml +++ b/.github/workflows/check-toc-task.yml @@ -35,7 +35,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/check-yaml-task.yml b/.github/workflows/check-yaml-task.yml index 6d0dc56a..e44625a6 100644 --- a/.github/workflows/check-yaml-task.yml +++ b/.github/workflows/check-yaml-task.yml @@ -53,7 +53,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/spell-check-task.yml b/.github/workflows/spell-check-task.yml index 20a3958d..27c24c28 100644 --- a/.github/workflows/spell-check-task.yml +++ b/.github/workflows/spell-check-task.yml @@ -21,7 +21,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" || diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 9602dcc6..f32ee5a6 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -1,6 +1,8 @@ name: Run integration tests on: + create: + pull_request: paths: - ".github/workflows/test-integration.yml" @@ -21,6 +23,14 @@ on: - "action.yml" - "compilesketches/**" + repository_dispatch: + + schedule: + # Run periodically to catch breakage caused by external changes. + - cron: "0 12 * * THU" + + workflow_dispatch: + env: SKETCHES_REPORTS_PATH: sketches-reports TESTDATA_PLATFORMS_PATH: .github/workflows/testdata/platforms @@ -28,7 +38,32 @@ env: TESTDATA_REPORTS_PATH: .github/workflows/testdata/reports jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" + # 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 + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + default-inputs: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: @@ -49,6 +84,8 @@ jobs: uses: ./extras/compile-sketches all-inputs: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -120,6 +157,8 @@ jobs: multiple-steps: name: multiple-steps (${{ matrix.board.source-type }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -209,6 +248,8 @@ jobs: - examples/Sweep python-package-dependency: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: @@ -239,6 +280,8 @@ jobs: # Targeted testing for ESP32 boards platform support. pyserial-dependency: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: @@ -267,7 +310,10 @@ jobs: - ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum check-sketches-reports: - needs: all-inputs + needs: + - run-determination + - all-inputs + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: @@ -334,6 +380,8 @@ jobs: exit $EXIT_STATUS expected-failed-compilation: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test-python-poetry-task.yml b/.github/workflows/test-python-poetry-task.yml index 3feb0eaf..9d091766 100644 --- a/.github/workflows/test-python-poetry-task.yml +++ b/.github/workflows/test-python-poetry-task.yml @@ -43,7 +43,7 @@ jobs: - name: Determine if the rest of the workflow should run id: determination run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ "${{ github.event_name }}" != "create" ||