diff --git a/.github/workflows/main-build-and-upload.yml b/.github/workflows/main-build-and-upload.yml index c18680f..dc49856 100644 --- a/.github/workflows/main-build-and-upload.yml +++ b/.github/workflows/main-build-and-upload.yml @@ -7,8 +7,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} jobs: build-dist: @@ -27,5 +26,3 @@ jobs: with: deploy: true secrets: inherit - - diff --git a/.github/workflows/pr-build-and-verify.yml b/.github/workflows/pr-build-and-verify.yml index 9e4b941..099c6c8 100644 --- a/.github/workflows/pr-build-and-verify.yml +++ b/.github/workflows/pr-build-and-verify.yml @@ -11,9 +11,15 @@ concurrency: cancel-in-progress: true jobs: + check-pr-status: + name: Check PR status + uses: nubificus/vaccel/.github/workflows/check-pr-status.yml@main + secrets: inherit + test-build: + needs: check-pr-status name: Test Build - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + if: ${{ needs.check-pr-status.outputs.expects-checks == 'true' }} uses: nubificus/vaccel/.github/workflows/test-build.yml@main with: options: '' @@ -21,8 +27,9 @@ jobs: secrets: inherit verify-build: + needs: check-pr-status name: Verify Build - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + if: ${{ needs.check-pr-status.outputs.expects-checks == 'true' }} uses: nubificus/vaccel/.github/workflows/verify-build.yml@main with: package: 'python' @@ -32,29 +39,49 @@ jobs: secrets: inherit validate-files-and-commits: + needs: check-pr-status name: Validate Files and Commits - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + if: ${{ needs.check-pr-status.outputs.expects-checks == 'true' }} uses: nubificus/vaccel/.github/workflows/validate-files-and-commits.yml@main secrets: inherit validate-code: + needs: check-pr-status name: Validate Code - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + if: ${{ needs.check-pr-status.outputs.expects-checks == 'true' }} uses: nubificus/vaccel/.github/workflows/validate-code.yml@main with: skip-cppcheck: true secrets: inherit generate-api-reference: - needs: [test-build, verify-build, validate-files-and-commits, validate-code] + needs: + - check-pr-status + - test-build + - verify-build + - validate-files-and-commits + - validate-code name: Generate API Reference - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} uses: ./.github/workflows/generate-api-reference.yml secrets: inherit generate-coverage: - needs: [generate-api-reference] + needs: generate-api-reference name: Generate Coverage Report uses: nubificus/vaccel/.github/workflows/coverage-report.yml@main with: comment-diff: true + + # Dummy job for setting required checks + jobs-completed: + needs: [check-pr-status, generate-coverage] + name: Jobs Completed + if: >- + ${{ always() && + (needs.check-pr-status.outputs.is-approved == 'true' || + (needs.check-pr-status.outputs.expects-checks == 'true' && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled'))) }} + runs-on: base-2204-amd64 + steps: + - run: exit 0 diff --git a/.github/workflows/pr-trailers.yml b/.github/workflows/pr-trailers.yml index c44534c..deb4341 100644 --- a/.github/workflows/pr-trailers.yml +++ b/.github/workflows/pr-trailers.yml @@ -3,10 +3,11 @@ name: Add Git Trailers to PR commits on: pull_request_review: types: [submitted] + pull_request: + types: [synchronize, labeled] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true jobs: # commit-coverage: @@ -17,9 +18,22 @@ jobs: # commit: true # secrets: inherit - git-trailers: -# needs: [commit-coverage] + check-pr-status: +# needs: commit-coverage + name: Check PR status + if: ${{ always() && github.event.pull_request.base.ref == 'main' }} + uses: nubificus/vaccel/.github/workflows/check-pr-status.yml@main + with: + pr-number: >- + ${{ github.event.pull_request_review.pull_request.number || + github.event.pull_request.number }} + secrets: inherit + + add-git-trailers: + needs: check-pr-status name: Add Git Trailers to PR commits - if: ${{ github.event.pull_request.base.ref == 'main' && github.event.review.state == 'approved' }} + if: >- + ${{ always() && github.event.pull_request.base.ref == 'main' && + needs.check-pr-status.outputs.is-approved == 'true' }} uses: nubificus/vaccel/.github/workflows/add-git-trailers.yml@main secrets: inherit