@@ -41,42 +41,11 @@ jobs:
41
41
if : contains(github.event.pull_request.labels.*.name, 'dependencies') || contains(github.event.pull_request.labels.*.name,
42
42
' safe-to-test' )
43
43
steps :
44
- # template: .action_templates/steps/checkout-fork .yaml
45
- - name : Checkout Code
46
- uses : actions/checkout@v4
44
+ # template: .action_templates/steps/cancel-previous .yaml
45
+ - name : Cancel Previous Runs
46
+
47
47
with :
48
- ref : ${{github.event.pull_request.head.sha}}
49
- repository : ${{github.event.pull_request.head.repo.full_name}}
50
- submodules : true
51
- # template: .action_templates/steps/setup-and-install-python.yaml
52
- - name : Setup Python
53
- uses : actions/setup-python@v5
54
- with :
55
- python-version : 3.10.4
56
- - name : Cache Dependencies
57
- uses : actions/cache@v4
58
- with :
59
- path : ~/.cache/pip
60
- key : ${{ hashFiles('requirements.txt') }}
61
- - name : Install Python Dependencies
62
- run : pip install -r requirements.txt
63
- # template: .action_templates/steps/quay-login.yaml
64
- - name : Login to Quay.io
65
- uses : docker/login-action@v3
66
- with :
67
- registry : quay.io
68
- username : ${{ secrets.QUAY_USERNAME }}
69
- password : ${{ secrets.QUAY_ROBOT_TOKEN }}
70
- # template: .action_templates/steps/set-up-qemu.yaml
71
- - name : Set up QEMU
72
- uses : docker/setup-qemu-action@v3
73
- # template: .action_templates/steps/build-and-push-development-images.yaml
74
- - name : Build and Push Images
75
- run : |
76
- python pipeline.py --image-name ${{ matrix.pipeline-argument }} --tag ${{ github.run_id }}
77
- env :
78
- MONGODB_COMMUNITY_CONFIG : ${{ github.workspace }}/scripts/ci/config.json
79
- version_id : ${{ github.run_id }}
48
+ access_token : ${{ github.token }}
80
49
# template: .action_templates/jobs/tests.yaml
81
50
tests :
82
51
runs-on : ubuntu-latest
@@ -147,84 +116,8 @@ jobs:
147
116
- test-name : replica_set_remove_user
148
117
distro : ubi
149
118
steps :
150
- # template: .action_templates/steps/checkout-fork.yaml
151
- - name : Checkout Code
152
- uses : actions/checkout@v4
153
- with :
154
- ref : ${{github.event.pull_request.head.sha}}
155
- repository : ${{github.event.pull_request.head.repo.full_name}}
156
- submodules : true
157
- # template: .action_templates/steps/set-run-status.yaml
158
- - name : Set default run status
159
- run : echo "::set-output name=last_run_status::pending" > last_run_status
160
-
161
- # Tracking of the state of the previous test run is a workaround to the fact that it is not
162
- # possible to re-run a single failed job, only re-running the entire workflow is currently possible.
163
- # This workaround skips jobs if they have already passed.
164
- # see https://github.com/actions/runner/issues/432
165
- - name : Restore last run status
166
- id : last_run
167
- uses : actions/cache@v4
168
- with :
169
- path : last_run_status
170
- key : ${{ github.run_id }}-${{ matrix.test-name }}-${{ matrix.distro }}
171
-
172
- - name : Set last run status
173
- id : last_run_status
174
- run : cat last_run_status
175
- # template: .action_templates/steps/setup-and-install-python.yaml
176
- - name : Setup Python
177
- uses : actions/setup-python@v5
178
- with :
179
- python-version : 3.10.4
180
- - name : Cache Dependencies
181
- uses : actions/cache@v4
182
- with :
183
- path : ~/.cache/pip
184
- key : ${{ hashFiles('requirements.txt') }}
185
- - name : Install Python Dependencies
186
- run : pip install -r requirements.txt
187
- # template: .action_templates/steps/setup-kind-cluster.yaml
188
- - name : Setup Kind Cluster
189
- run : |
190
- curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
191
- chmod +x ./kind
192
- ./kind create cluster
193
- if : steps.last_run_status.outputs.last_run_status != 'success'
194
- - name : Create Directories
195
- run : |
196
- docker exec kind-control-plane mkdir -p /opt/data/mongo-data-0 /opt/data/mongo-data-1 /opt/data/mongo-data-2 /opt/data/mongo-logs-0 /opt/data/mongo-logs-1 /opt/data/mongo-logs-2
197
-
198
- if : steps.last_run_status.outputs.last_run_status != 'success'
199
- - name : Install CRD
200
- run : kubectl apply -f config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml
201
- if : steps.last_run_status.outputs.last_run_status != 'success'
202
- # template: .action_templates/steps/run-test-matrix.yaml
203
- - name : Run Test
204
- id : e2e_test
205
- if : steps.last_run_status.outputs.last_run_status != 'success'
206
- run : |
207
- cluster_wide=${{ matrix.cluster-wide }}
208
- if [ -z "$cluster_wide" ]; then
209
- cluster_wide="false"
210
- fi
211
- python3 ./scripts/dev/e2e.py --test ${{ matrix.test-name }} --tag ${{ github.run_id }} --config_file ./scripts/ci/config.json --distro ${{ matrix.distro }} --cluster-wide ${cluster_wide}
212
- # template: .action_templates/steps/save-run-status.yaml
213
- - name : Save run status
214
- if : always()
215
- run : echo "::set-output name=last_run_status::${{ steps.e2e_test.outcome }}"
216
- > last_run_status
217
- # template: .action_templates/steps/dump-and-upload-diagnostics.yaml
218
- - name : Dump Diagnostics
219
- id : dump_diagnostics
220
- if : always() && steps.e2e_test.outcome == 'failure'
221
- continue-on-error : true
222
- run : scripts/ci/dump_diagnostics.sh default # default since kind is running in the default namespace
223
-
224
- - name : Upload Diagnostics
225
- if : always() && steps.dump_diagnostics.outcome == 'success'
226
- uses : actions/upload-artifact@v4
227
- continue-on-error : true
119
+ # template: .action_templates/steps/cancel-previous.yaml
120
+ - name : Cancel Previous Runs
121
+
228
122
with :
229
- name : ${{ matrix.test-name }}-${{ matrix.distro }}-diagnostics
230
- path : ${{ github.workspace }}/diagnostics
123
+ access_token : ${{ github.token }}
0 commit comments