diff --git a/.github/workflows/pr-pre-post-merge.yml b/.github/workflows/pr-pre-post-merge.yml index 5b0ca614..635780aa 100644 --- a/.github/workflows/pr-pre-post-merge.yml +++ b/.github/workflows/pr-pre-post-merge.yml @@ -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 }}