-
Notifications
You must be signed in to change notification settings - Fork 58
56 lines (50 loc) · 1.52 KB
/
Copy pathpr-ci.yml
File metadata and controls
56 lines (50 loc) · 1.52 KB
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
name: CI
on:
workflow_call:
inputs:
trigger:
required: false
type: string
default: "merge_group"
push:
branches:
- staging
- trying
pull_request:
types: ['opened', 'reopened', 'synchronize']
merge_group:
jobs:
lint-ci:
if: inputs.trigger != 'try'
uses: ./.github/workflows/lint.yml
helm-ci:
uses: ./.github/workflows/helm-chart.yml
secrets: inherit
with:
trigger: ${{ inputs.trigger == 'try' && 'try' || startsWith(github.head_ref, 'mergify/merge-queue/') && 'merge_group' || github.event_name}}
int-ci:
if: inputs.trigger != 'try'
uses: ./.github/workflows/unit-int.yml
image-ci:
if: github.event_name != 'pull_request' || inputs.trigger == 'try' || startsWith(github.head_ref, 'mergify/merge-queue/')
uses: ./.github/workflows/image-pr.yml
k8s-ci:
if: github.event_name != 'pull_request' || inputs.trigger == 'try' || startsWith(github.head_ref, 'mergify/merge-queue/')
uses: ./.github/workflows/k8s-ci.yml
secrets: inherit
ci:
if: ${{ !cancelled() && (github.event_name != 'pull_request' || inputs.trigger == 'try' || startsWith(github.head_ref, 'mergify/merge-queue/')) }}
needs:
- lint-ci
- helm-ci
- int-ci
- image-ci
- k8s-ci
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
exit 1
fi
exit 0