-
Notifications
You must be signed in to change notification settings - Fork 5
138 lines (127 loc) · 3.64 KB
/
main.yml
File metadata and controls
138 lines (127 loc) · 3.64 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
#
# SPDX-License-Identifier: Apache-2.0
name: Main
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
push:
branches:
- main
workflow_dispatch:
inputs:
ref:
description: The ref sha to checkout evp-agent-oss
type: string
required: false
default: main
package-namespace:
description: The package namespace for docker images
required: true
type: string
workflow_call:
inputs:
ref:
description: The ref sha to checkout evp-agent-oss
type: string
required: false
default: main
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}@main-${{ github.ref }}
cancel-in-progress: true
jobs:
infos:
name: Infos
runs-on: ubuntu-22.04
outputs:
package-namespace: ${{ steps.infos.outputs.namespace }}
steps:
- name: Some infos
id: infos
run: |
echo github.ref is ${{ github.ref }}
echo github.head_ref is ${{ github.head_ref }}
echo github.sha is ${{ github.sha }}
echo github.event_name is ${{ github.event_name }}
echo github.event.pull_request.user.login is ${{ github.event.pull_request.user.login }}
echo github.event.action is ${{ github.event.action }}
echo github.event.repository_owner is ${{ github.repository_owner }}
NAMESPACE=${{ github.repository || github.event.repository }}
NAMESPACE_LC=${NAMESPACE@L}
echo "namespace=${NAMESPACE_LC}" >> $GITHUB_OUTPUT
echo namespace is ${NAMESPACE_LC}
builder:
name: Builder
needs:
- infos
uses: ./.github/workflows/builder.yml
secrets: inherit
with:
ref: ${{ inputs.ref || github.sha }}
package-namespace: ${{ needs.infos.outputs.package-namespace }}
checks:
name: Checks
needs:
- builder
- infos
uses: ./.github/workflows/check.yml
secrets: inherit
with:
builder-tag: ${{ needs.builder.outputs.builder-tag }}
ref: ${{ inputs.ref || github.sha }}
package-namespace: ${{ needs.infos.outputs.package-namespace }}
build-sdk:
name: Build
needs:
- checks
- builder
- infos
uses: ./.github/workflows/build-sdk.yml
secrets: inherit
with:
builder-tag: ${{ needs.builder.outputs.builder-tag }}
ref: ${{ inputs.ref || github.sha }}
package-namespace: ${{ needs.infos.outputs.package-namespace }}
build-agent:
name: Build
needs:
- checks
- builder
- infos
uses: ./.github/workflows/build.yml
secrets: inherit
with:
builder-tag: ${{ needs.builder.outputs.builder-tag }}
ref: ${{ inputs.ref || github.sha }}
package-namespace: ${{ needs.infos.outputs.package-namespace }}
tests:
name: Tests
needs:
- checks
- builder
- infos
uses: ./.github/workflows/test.yml
secrets: inherit
with:
builder-tag: ${{ needs.builder.outputs.builder-tag }}
ref: ${{ inputs.ref || github.sha }}
package-namespace: ${{ needs.infos.outputs.package-namespace }}
checkpoint-success:
if: ${{ always() }}
runs-on: ubuntu-22.04
needs:
- tests
- build-agent
steps:
- name: Check all previous jobs finished correctly
run: |
if [ "${{ needs.tests.result }}" = "success" ]; then
echo Requested jobs finished successfully. This PR can be merged
else
echo Requested jobs are failing. This PR can not be merged
exit 1
fi