-
Notifications
You must be signed in to change notification settings - Fork 65
163 lines (152 loc) · 4.53 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
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
name: Pull Request
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
env:
IS_GITHUB_ACTION: true
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
packages:
name: Packages
runs-on: ubuntu-latest
# timeout-minutes: 10
outputs:
awx: ${{ steps.changed-awx.outputs.changed == 'true' }}
hub: ${{ steps.changed-hub.outputs.changed == 'true' }}
eda: ${{ steps.changed-eda.outputs.changed == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- uses: actions/setup-node@v4
with:
node-version: 20
- name: PreCache
run: npm version 0.0.0 --no-git-tag-version
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: |
./node_modules
/home/runner/.cache/Cypress
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- id: changed-awx
run: |
if $(git diff --quiet HEAD^ HEAD -- frontend/awx frontend/common cypress/e2e/awx framework cypress/support package.json); then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- id: changed-hub
run: |
if $(git diff --quiet HEAD^ HEAD -- frontend/hub frontend/common cypress/e2e/hub framework cypress/support package.json); then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- id: changed-eda
run: |
if $(git diff --quiet HEAD^ HEAD -- frontend/eda frontend/common cypress/e2e/eda framework cypress/support package.json); then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
pr-queue:
name: PR Queue
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ahmadnassri/action-workflow-queue@v1
with:
delay: 60000
timeout: 14400000
checks:
name: ESLint - Prettier - TSC
runs-on: ubuntu-latest
# timeout-minutes: 10
needs: packages
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: 20
- name: PreCache
run: npm version 0.0.0 --no-git-tag-version
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: |
./node_modules
/home/runner/.cache/Cypress
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm run checks
awx-e2e:
name: AWX E2E
needs:
- packages
- pr-queue
uses: ./.github/workflows/awx-e2e.yml
with:
AWX_SERVER: ${{ vars.AWX_SERVER }}
SKIP_JOB: ${{ needs.packages.outputs.awx != 'true' }}
secrets:
AWX_PASSWORD: ${{ secrets.AWX_PASSWORD }}
AWX_PROJECT_ID: ${{ secrets.AWX_PROJECT_ID }}
AWX_RECORD_KEY: ${{ secrets.AWX_RECORD_KEY }}
# eda-e2e:
# name: EDA E2E
# needs:
# - packages
# - pr-queue
# uses: ./.github/workflows/eda-e2e.yml
# with:
# EDA_SERVER: ${{ vars.EDA_SERVER }}
# SKIP_JOB: ${{ needs.packages.outputs.eda != 'true' }}
# secrets:
# EDA_PASSWORD: ${{ secrets.EDA_PASSWORD }}
# EDA_PROJECT_ID: ${{ secrets.EDA_PROJECT_ID }}
# EDA_RECORD_KEY: ${{ secrets.EDA_RECORD_KEY }}
hub-e2e:
name: HUB E2E
needs:
- packages
- pr-queue
uses: ./.github/workflows/hub-e2e.yml
with:
HUB_SERVER: ${{ vars.HUB_SERVER }}
SKIP_JOB: ${{ needs.packages.outputs.hub != 'true' }}
secrets:
HUB_PASSWORD: ${{ secrets.HUB_PASSWORD }}
HUB_PROJECT_ID: ${{ secrets.HUB_PROJECT_ID }}
HUB_RECORD_KEY: ${{ secrets.HUB_RECORD_KEY }}
component:
name: Component
needs: packages
uses: ./.github/workflows/component.yml
secrets:
COMPONENT_PROJECT_ID: ${{ secrets.COMPONENT_PROJECT_ID }}
COMPONENT_RECORD_KEY: ${{ secrets.COMPONENT_RECORD_KEY }}
success:
name: Success
runs-on: ubuntu-latest
if: ${{ success() }}
needs:
- checks
- component
- awx-e2e
# - eda-e2e
- hub-e2e
steps:
- run: echo Success