Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions .github/workflows/pr-pre-post-merge.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
name: PR Pre and Post Merge Build
description: |
Test a package build pre and post merge.
When a PR is opened, synchronized or reopened against debian/latest, this workflow will test that the package builds successfully inside the PR.
The user will want to mark this check as required in branch protection rules to ensure that PRs cannot be merged unless the package builds successfully.
When a PR is closed AND merged, this workflow will test that debian/latest builds successfully and push the new package to the staging repo.
This is controled by the is-post-merge input to the reusable workflow, which is set based on the PR action and merged status.
This workflow will explicitely NOT run on closed but unmerged PRs to avoid unnecessary builds (say in the case of a declined PR)

on:
pull_request_target:
branches: [ debian/* ]
pull_request:
branches: [ debian/*, qcom/** ]
types: [ opened, synchronize, reopened, closed ]

permissions:
contents: read
packages: read

jobs:

build:

# This condition ensures that the job runs for all PR actions except closed unmerged,
# i.e., it runs for opened, synchronize, reopened (pre-merge) and closed merged (post-merge).
if: ${{ github.event.action != 'closed' || github.event.pull_request.merged == true }}

name: Build Debian Package
uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-build-pkg-reusable-workflow.yml@main
if: ${{ github.event.action != 'closed' || github.event.pull_request.merged == true }}
with:
qcom-build-utils-ref: main

qcom-build-utils-ref: main
# PRE-MERGE: use the PR head branch (github.head_ref)
# POST-MERGE: use the base branch name from the PR (e.g. "debian/latest")
# POST-MERGE: use the base branch name from the PR (e.g. "debian/qcom-next")
debian-ref: ${{ (github.event.action == 'closed' && github.event.pull_request.merged) && github.event.pull_request.base.ref || github.head_ref }}
run-abi-checker: true
# True if the PR was merged (i.e. post-merge): closed & merged
is-post-merge: ${{ github.event.action == 'closed' && github.event.pull_request.merged == true }}

secrets:
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
debusine-parent-workspace: ${{ vars.DEBUSINE_PARENT_WORKSPACE }}
Loading