-
Notifications
You must be signed in to change notification settings - Fork 4
167 lines (163 loc) · 5.42 KB
/
ci.yaml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CICD workflow
on:
push:
env:
WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
CICD_REPO_PATH: ${{ secrets.CICD_REPO_PATH }}
jobs:
ci:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
outputs:
api: ${{ steps.api-step.outputs.api }}
collaborative: ${{ steps.collaborative-step.outputs.collaborative }}
frontend: ${{ steps.frontend-step.outputs.frontend }}
workerray: ${{ steps.worker-ray-step.outputs.workerray }}
data: ${{ steps.data-step.outputs.data }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '2'
- name: fetch main
run: |
git fetch origin main --depth 1
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install workflow dependencies
run: |
pip install requests GitPython
- id: api-step
name: Check change in api
run: |
api=$(python ./monorepo/cicd.py -c "origin/main" --project morpheus-server)
echo "api=$api" >> "$GITHUB_OUTPUT"
- id: collaborative-step
name: Check change in collaborative
run: |
collaborative=$(python ./monorepo/cicd.py -c "origin/main" --project morpheus-collaborative)
echo "collaborative=$collaborative" >> "$GITHUB_OUTPUT"
- id: frontend-step
name: Check change in frontend
run: |
frontend=$(python ./monorepo/cicd.py -c "origin/main" --project morpheus-client)
echo "frontend=$frontend" >> "$GITHUB_OUTPUT"
- id: worker-ray-step
name: Check change in worker ray
run: |
workerray=$(python ./monorepo/cicd.py -c "origin/main" --project morpheus-worker-ray)
echo "workerray=$workerray" >> "$GITHUB_OUTPUT"
- id: data-step
name: Check change in data
run: |
data=$(python ./monorepo/cicd.py -c "origin/main" --project morpheus-data)
echo "data=$data" >> "$GITHUB_OUTPUT"
ci-data:
if: needs.ci.outputs.data == 'true'
needs:
- ci
uses: ./.github/workflows/ci-data.yaml
secrets: inherit
ci-api:
if: ${{ !failure() && !cancelled() && (needs.ci.outputs.api == 'true' || needs.ci.outputs.data == 'true') }}
needs:
- ci
- ci-data
uses: ./.github/workflows/ci-api.yaml
secrets: inherit
ci-collaborative:
if: needs.ci.outputs.collaborative == 'true'
needs:
- ci
uses: ./.github/workflows/ci-collaborative.yaml
secrets: inherit
ci-frontend:
if: needs.ci.outputs.frontend == 'true'
needs:
- ci
uses: ./.github/workflows/ci-frontend.yaml
secrets: inherit
ci-worker-ray:
if: needs.ci.outputs.workerray == 'true'
needs:
- ci
uses: ./.github/workflows/ci-worker-ray.yaml
secrets: inherit
#############################################################################################################
### CD - jobs
#############################################################################################################
cd:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
outputs:
api: ${{ steps.api-step.outputs.api }}
collaborative: ${{ steps.collaborative-step.outputs.collaborative }}
frontend: ${{ steps.frontend-step.outputs.frontend }}
workerray: ${{ steps.worker-ray-step.outputs.workerray }}
data: ${{ steps.data-step.outputs.data }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '2'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install workflow dependencies
run: |
pip install requests GitPython
- id: api-step
name: Check change in api
run: |
api=$(python ./monorepo/cicd.py --project morpheus-server)
echo "api=$api" >> "$GITHUB_OUTPUT"
- id: collaborative-step
name: Check change in collaborative
run: |
collaborative=$(python ./monorepo/cicd.py --project morpheus-collaborative)
echo "collaborative=$collaborative" >> "$GITHUB_OUTPUT"
- id: frontend-step
name: Check change in frontend
run: |
frontend=$(python ./monorepo/cicd.py --project morpheus-client)
echo "frontend=$frontend" >> "$GITHUB_OUTPUT"
- id: worker-ray-step
name: Check change in worker ray
run: |
workerray=$(python ./monorepo/cicd.py --project morpheus-worker-ray)
echo "workerray=$workerray" >> "$GITHUB_OUTPUT"
- id: data-step
name: Check change in data
run: |
data=$(python ./monorepo/cicd.py --project morpheus-data)
echo "data=$data" >> "$GITHUB_OUTPUT"
cd-data:
if: needs.cd.outputs.data == 'true'
needs:
- cd
uses: ./.github/workflows/cd-data.yaml
secrets: inherit
cd-api:
if: needs.cd.outputs.api == 'true' || needs.cd.outputs.data == 'true'
needs:
- cd
- cd-data
uses: ./.github/workflows/cd-api.yaml
secrets: inherit
cd-frontend:
if: needs.cd.outputs.frontend == 'true'
needs:
- cd
uses: ./.github/workflows/cd-frontend.yaml
secrets: inherit
cd-collaborative:
if: needs.cd.outputs.collaborative == 'true'
needs:
- cd
uses: ./.github/workflows/cd-collaborative.yaml
secrets: inherit
cd-worker-ray:
if: needs.cd.outputs.workerray == 'true'
needs:
- cd
uses: ./.github/workflows/cd-worker-ray.yaml
secrets: inherit