-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (97 loc) · 3.77 KB
/
pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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 }}