Skip to content

Commit df9cde8

Browse files
eblanco-ansyspyansys-ci-botSamuelopez-ansys
authored
CI: Fix block cache update (ansys#7162)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Samuel Lopez <[email protected]>
1 parent 422a672 commit df9cde8

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

.github/workflows/update-testmondata-cache.yml

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Update Testmon Cache on Merge
22

33
on:
4-
pull_request:
5-
types:
6-
- closed
4+
push:
75
branches:
86
- main
97
workflow_dispatch:
@@ -38,12 +36,25 @@ env:
3836
TESTMON_CACHE_KEY_EMIT_WIN: 'testmondata-emit-win'
3937

4038
jobs:
39+
# ------------------------------------------------------------------
40+
# WORKFLOW DISPATCH GUARD
41+
# ------------------------------------------------------------------
42+
check-reference:
43+
name: Check reference is main
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Check reference is main
47+
if: ${{ github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main' }}
48+
run: |
49+
echo "This workflow can only run on main"
50+
exit 1
51+
4152
# ------------------------------------------------------------------
4253
# UNIT TESTS CACHE UPDATE (LINUX)
4354
# ------------------------------------------------------------------
4455
update-unit-linux:
4556
name: Update unit test cache (Linux)
46-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
57+
needs: check-reference
4758
runs-on: ubuntu-latest
4859
permissions:
4960
actions: write # Needed to delete cache
@@ -119,7 +130,7 @@ jobs:
119130
# ------------------------------------------------------------------
120131
update-integration-linux:
121132
name: Update integration test cache (Linux)
122-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
133+
needs: check-reference
123134
runs-on: ubuntu-latest
124135
permissions:
125136
actions: write # Needed to delete cache
@@ -191,7 +202,7 @@ jobs:
191202
# ------------------------------------------------------------------
192203
update-solvers-win:
193204
name: Update solvers test cache (Windows)
194-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
205+
needs: check-reference
195206
runs-on: [ self-hosted, Windows, pyaedt ]
196207
permissions:
197208
actions: write # Needed to delete cache
@@ -277,7 +288,7 @@ jobs:
277288
# ------------------------------------------------------------------
278289
update-solvers-linux:
279290
name: Update solvers test cache (Linux)
280-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
291+
needs: check-reference
281292
runs-on: [ self-hosted, Linux, pyaedt ]
282293
permissions:
283294
actions: write # Needed to delete cache
@@ -362,7 +373,7 @@ jobs:
362373
# ------------------------------------------------------------------
363374
update-general-win:
364375
name: Update general test cache (Windows)
365-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
376+
needs: check-reference
366377
runs-on: [ self-hosted, Windows, pyaedt ]
367378
permissions:
368379
actions: write # Needed to delete cache
@@ -451,7 +462,7 @@ jobs:
451462
# ------------------------------------------------------------------
452463
update-general-linux:
453464
name: Update general test cache (Linux)
454-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
465+
needs: check-reference
455466
runs-on: [ self-hosted, Linux, pyaedt ]
456467
permissions:
457468
actions: write # Needed to delete cache
@@ -538,7 +549,7 @@ jobs:
538549
# ------------------------------------------------------------------
539550
update-visualization-win:
540551
name: Update visualization test cache (Windows)
541-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
552+
needs: check-reference
542553
runs-on: [ self-hosted, Windows, pyaedt ]
543554
permissions:
544555
actions: write # Needed to delete cache
@@ -628,7 +639,7 @@ jobs:
628639
# ------------------------------------------------------------------
629640
update-visualization-linux:
630641
name: Update visualization test cache (Linux)
631-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
642+
needs: check-reference
632643
runs-on: [ self-hosted, Linux, pyaedt ]
633644
permissions:
634645
actions: write # Needed to delete cache
@@ -716,7 +727,7 @@ jobs:
716727
# ------------------------------------------------------------------
717728
update-icepak-win:
718729
name: Update icepak test cache (Windows)
719-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
730+
needs: check-reference
720731
runs-on: [ self-hosted, Windows, pyaedt ]
721732
permissions:
722733
actions: write # Needed to delete cache
@@ -802,7 +813,7 @@ jobs:
802813
# ------------------------------------------------------------------
803814
update-icepak-linux:
804815
name: Update icepak test cache (Linux)
805-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
816+
needs: check-reference
806817
runs-on: [ self-hosted, Linux, pyaedt ]
807818
permissions:
808819
actions: write # Needed to delete cache
@@ -887,7 +898,7 @@ jobs:
887898
# ------------------------------------------------------------------
888899
update-layout-win:
889900
name: Update layout test cache (Windows)
890-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
901+
needs: check-reference
891902
runs-on: [ self-hosted, Windows, pyaedt ]
892903
permissions:
893904
actions: write # Needed to delete cache
@@ -972,7 +983,7 @@ jobs:
972983
# ------------------------------------------------------------------
973984
update-layout-linux:
974985
name: Update layout test cache (Linux)
975-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
986+
needs: check-reference
976987
runs-on: [ self-hosted, Linux, pyaedt ]
977988
permissions:
978989
actions: write # Needed to delete cache
@@ -1057,7 +1068,7 @@ jobs:
10571068
# ------------------------------------------------------------------
10581069
update-extensions-win:
10591070
name: Update extensions test cache (Windows)
1060-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
1071+
needs: check-reference
10611072
runs-on: [ self-hosted, Windows, pyaedt ]
10621073
permissions:
10631074
actions: write # Needed to delete cache
@@ -1146,7 +1157,7 @@ jobs:
11461157
# ------------------------------------------------------------------
11471158
update-extensions-linux:
11481159
name: Update extensions test cache (Linux)
1149-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
1160+
needs: check-reference
11501161
runs-on: [ self-hosted, Linux, pyaedt ]
11511162
permissions:
11521163
actions: write # Needed to delete cache
@@ -1233,7 +1244,7 @@ jobs:
12331244
# ------------------------------------------------------------------
12341245
update-filter-win:
12351246
name: Update filter test cache (Windows)
1236-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
1247+
needs: check-reference
12371248
runs-on: [ self-hosted, Windows, pyaedt ]
12381249
permissions:
12391250
actions: write # Needed to delete cache
@@ -1319,7 +1330,7 @@ jobs:
13191330
# ------------------------------------------------------------------
13201331
update-emit-win:
13211332
name: Update emit test cache (Windows)
1322-
if: ${{ (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || github.event.pull_request.merged == true }}
1333+
needs: check-reference
13231334
runs-on: [ self-hosted, Windows, pyaedt ]
13241335
permissions:
13251336
actions: write # Needed to delete cache
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix block cache update

0 commit comments

Comments
 (0)