Skip to content

Commit

Permalink
github ci: also trigger build-tests on pull-requests
Browse files Browse the repository at this point in the history
Also trigger the CI build pipeline on pull-request actions. This is due
to the CI not running on the branch when triggered from an action. This
happens when bumping Gluon.

As the ressources are not that much of an concern, trigger the
build-test twice in worst-case.

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed Dec 15, 2023
1 parent 0fbc457 commit de00392
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/build-meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ elif [ "$GITHUB_EVENT_NAME" = "push" ] && [ "$GITHUB_REF_TYPE" = "tag" ]; then
fi

CREATE_RELEASE="1"
elif [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
elif [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ] || [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
# Workflow Dispatch - autoupdater Branch is testing and disabled
AUTOUPDATER_ENABLED="0"
AUTOUPDATER_BRANCH="testing"
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: "Build Gluon images"

# yamllint disable-line rule:truthy
on:
pull_request:
push:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -163,12 +164,13 @@ jobs:

build:
needs: [targets, build-meta, host-tools]
if: ${{ needs.targets.outputs.targets != '[]' }}
strategy:
fail-fast: false
matrix:
target: ${{ fromJSON(needs.targets.outputs.targets) }}
runs-on: ubuntu-22.04
if: >
needs.targets.outputs.targets != '[]'
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -238,6 +240,9 @@ jobs:
manifest:
needs: [build, build-meta, targets]
runs-on: ubuntu-22.04
if: >
needs.targets.outputs.targets != '[]' &&
github.event_name == 'push'
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -349,7 +354,10 @@ jobs:
deploy:
needs: [build, build-meta, targets, manifest]
runs-on: ubuntu-22.04
if: ${{ needs.build-meta.outputs.deploy != '0' }}
if: >
needs.targets.outputs.targets != '[]' &&
needs.build-meta.outputs.deploy != '0' &&
github.event_name == 'push'
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -392,7 +400,10 @@ jobs:
create-release:
needs: [build, build-meta, targets, manifest]
runs-on: ubuntu-22.04
if: ${{ needs.build-meta.outputs.create-release != '0' }}
if: >
needs.targets.outputs.targets != '[]' &&
needs.build-meta.outputs.create-release != '0' &&
github.event_name == 'push'
permissions:
contents: write
steps:
Expand Down

0 comments on commit de00392

Please sign in to comment.