Skip to content

PR #4 [reviewed, approved, draft] Restrict event triggers #41

PR #4 [reviewed, approved, draft] Restrict event triggers

PR #4 [reviewed, approved, draft] Restrict event triggers #41

Workflow file for this run

name: Pull Request
run-name: |
PR #${{ github.event.pull_request.number }} [${{ github.event_name == 'pull_request' && 'updated' || 'reviewed' }}, ${{ github.event_name == 'pull_request' && github.event.action || github.event.review.state }}${{ github.event.pull_request.draft && ', draft' || '' }}] ${{github.event.pull_request.title}}
on:
pull_request:
branches:
- master
paths-ignore:
# No sense in doing these tests for these file
- 'README.md'
- 'docs/**/*'
types:
- opened
- synchronize
- ready_for_review
- converted_to_draft
pull_request_review:
types: [submitted]
concurrency:
group: pr-test-${{ github.ref }}-${{github.event_name}}
cancel-in-progress: true
permissions:
packages: read
contents: read
env:
CLONE_DIR: src/repo
jobs:
check-trigger:
runs-on: ubuntu-latest
outputs:
BASIC_VALIDATION_BUILD_PLATFORMS: ${{ steps.config.outputs.BASIC_VALIDATION_BUILD_PLATFORMS }}
BASIC_VALIDATION_BASE_IMAGES: ${{ steps.config.outputs.BASIC_VALIDATION_BASE_IMAGES }}
DEB_VALIDATION_BASE_IMAGES: ${{ steps.config.outputs.DEB_VALIDATION_BASE_IMAGES }}
DEB_VALIDATION_BUILD_ARCHITECTURES: ${{ steps.config.outputs.DEB_VALIDATION_BUILD_ARCHITECTURES }}
FULL_VALIDATION_BASE_IMAGES: ${{ steps.config.outputs.FULL_VALIDATION_BASE_IMAGES }}
FULL_VALIDATION_BUILD_PLATFORMS: ${{ steps.config.outputs.FULL_VALIDATION_BUILD_PLATFORMS }}
VALIDATE_BASIC: ${{ steps.config.outputs.VALIDATE_BASIC }}
VALIDATE_DEB: ${{ steps.config.outputs.VALIDATE_DEB }}
VALIDATE_FULL: ${{ steps.config.outputs.VALIDATE_FULL }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Clone source repository
uses: actions/checkout@v4
with:
path: ${{ env.CLONE_DIR }}
submodules: true
- name: Configure workflow
id: config
shell: python
run: |
import sys
sys.path.insert(0, "${{ env.CLONE_DIR }}/.github")
from workflows_pyconfig import configure
configure(
workflow="pull_request",
github="""${{ toJson(github) }}""")
basic-validation:
needs: check-trigger
if: ${{ needs.check-trigger.outputs.VALIDATE_BASIC }}
strategy:
matrix:
build-platform: ${{ fromJson(needs.check-trigger.outputs.BASIC_VALIDATION_BUILD_PLATFORMS) }}
base-image: ${{ fromJson(needs.check-trigger.outputs.BASIC_VALIDATION_BASE_IMAGES) }}
uses: ./.github/workflows/_ci_build.yml
secrets: inherit
with:
build-platform: ${{matrix.build-platform}}
base-image: ${{matrix.base-image}}
full-validation:
needs: check-trigger
if: ${{ needs.check-trigger.outputs.VALIDATE_FULL }}
strategy:
matrix:
build-platform: ${{ fromJson(needs.check-trigger.outputs.FULL_VALIDATION_BUILD_PLATFORMS) }}
base-image: ${{ fromJson(needs.check-trigger.outputs.FULL_VALIDATION_BASE_IMAGES) }}
# [IMPLEMENTME] These values are "hard-coded" and must be updated manually here
exclude:
- build-platform: amd64
base-image: "ubuntu:22.04"
uses: ./.github/workflows/_ci_build.yml
secrets: inherit
with:
build-platform: ${{matrix.build-platform}}
base-image: ${{matrix.base-image}}
deb-validation:
needs: check-trigger
if: ${{ needs.check-trigger.outputs.VALIDATE_DEB }}
strategy:
matrix:
build-architecture: ${{ fromJson(needs.check-trigger.outputs.DEB_VALIDATION_BUILD_ARCHITECTURES) }}
base-image: ${{ fromJson(needs.check-trigger.outputs.DEB_VALIDATION_BASE_IMAGES) }}
uses: ./.github/workflows/_deb_build.yml
secrets: inherit
with:
base-image: ${{ matrix.base-image }}
build-architecture: ${{ matrix.build-architecture }}