|
1 | 1 | name: Update Testmon Cache on Merge |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - types: |
6 | | - - closed |
| 4 | + push: |
7 | 5 | branches: |
8 | 6 | - main |
9 | 7 | workflow_dispatch: |
|
38 | 36 | TESTMON_CACHE_KEY_EMIT_WIN: 'testmondata-emit-win' |
39 | 37 |
|
40 | 38 | 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 | +
|
41 | 52 | # ------------------------------------------------------------------ |
42 | 53 | # UNIT TESTS CACHE UPDATE (LINUX) |
43 | 54 | # ------------------------------------------------------------------ |
44 | 55 | update-unit-linux: |
45 | 56 | 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 |
47 | 58 | runs-on: ubuntu-latest |
48 | 59 | permissions: |
49 | 60 | actions: write # Needed to delete cache |
@@ -119,7 +130,7 @@ jobs: |
119 | 130 | # ------------------------------------------------------------------ |
120 | 131 | update-integration-linux: |
121 | 132 | 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 |
123 | 134 | runs-on: ubuntu-latest |
124 | 135 | permissions: |
125 | 136 | actions: write # Needed to delete cache |
@@ -191,7 +202,7 @@ jobs: |
191 | 202 | # ------------------------------------------------------------------ |
192 | 203 | update-solvers-win: |
193 | 204 | 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 |
195 | 206 | runs-on: [ self-hosted, Windows, pyaedt ] |
196 | 207 | permissions: |
197 | 208 | actions: write # Needed to delete cache |
@@ -277,7 +288,7 @@ jobs: |
277 | 288 | # ------------------------------------------------------------------ |
278 | 289 | update-solvers-linux: |
279 | 290 | 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 |
281 | 292 | runs-on: [ self-hosted, Linux, pyaedt ] |
282 | 293 | permissions: |
283 | 294 | actions: write # Needed to delete cache |
@@ -362,7 +373,7 @@ jobs: |
362 | 373 | # ------------------------------------------------------------------ |
363 | 374 | update-general-win: |
364 | 375 | 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 |
366 | 377 | runs-on: [ self-hosted, Windows, pyaedt ] |
367 | 378 | permissions: |
368 | 379 | actions: write # Needed to delete cache |
@@ -451,7 +462,7 @@ jobs: |
451 | 462 | # ------------------------------------------------------------------ |
452 | 463 | update-general-linux: |
453 | 464 | 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 |
455 | 466 | runs-on: [ self-hosted, Linux, pyaedt ] |
456 | 467 | permissions: |
457 | 468 | actions: write # Needed to delete cache |
@@ -538,7 +549,7 @@ jobs: |
538 | 549 | # ------------------------------------------------------------------ |
539 | 550 | update-visualization-win: |
540 | 551 | 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 |
542 | 553 | runs-on: [ self-hosted, Windows, pyaedt ] |
543 | 554 | permissions: |
544 | 555 | actions: write # Needed to delete cache |
@@ -628,7 +639,7 @@ jobs: |
628 | 639 | # ------------------------------------------------------------------ |
629 | 640 | update-visualization-linux: |
630 | 641 | 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 |
632 | 643 | runs-on: [ self-hosted, Linux, pyaedt ] |
633 | 644 | permissions: |
634 | 645 | actions: write # Needed to delete cache |
@@ -716,7 +727,7 @@ jobs: |
716 | 727 | # ------------------------------------------------------------------ |
717 | 728 | update-icepak-win: |
718 | 729 | 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 |
720 | 731 | runs-on: [ self-hosted, Windows, pyaedt ] |
721 | 732 | permissions: |
722 | 733 | actions: write # Needed to delete cache |
@@ -802,7 +813,7 @@ jobs: |
802 | 813 | # ------------------------------------------------------------------ |
803 | 814 | update-icepak-linux: |
804 | 815 | 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 |
806 | 817 | runs-on: [ self-hosted, Linux, pyaedt ] |
807 | 818 | permissions: |
808 | 819 | actions: write # Needed to delete cache |
@@ -887,7 +898,7 @@ jobs: |
887 | 898 | # ------------------------------------------------------------------ |
888 | 899 | update-layout-win: |
889 | 900 | 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 |
891 | 902 | runs-on: [ self-hosted, Windows, pyaedt ] |
892 | 903 | permissions: |
893 | 904 | actions: write # Needed to delete cache |
@@ -972,7 +983,7 @@ jobs: |
972 | 983 | # ------------------------------------------------------------------ |
973 | 984 | update-layout-linux: |
974 | 985 | 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 |
976 | 987 | runs-on: [ self-hosted, Linux, pyaedt ] |
977 | 988 | permissions: |
978 | 989 | actions: write # Needed to delete cache |
@@ -1057,7 +1068,7 @@ jobs: |
1057 | 1068 | # ------------------------------------------------------------------ |
1058 | 1069 | update-extensions-win: |
1059 | 1070 | 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 |
1061 | 1072 | runs-on: [ self-hosted, Windows, pyaedt ] |
1062 | 1073 | permissions: |
1063 | 1074 | actions: write # Needed to delete cache |
@@ -1146,7 +1157,7 @@ jobs: |
1146 | 1157 | # ------------------------------------------------------------------ |
1147 | 1158 | update-extensions-linux: |
1148 | 1159 | 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 |
1150 | 1161 | runs-on: [ self-hosted, Linux, pyaedt ] |
1151 | 1162 | permissions: |
1152 | 1163 | actions: write # Needed to delete cache |
@@ -1233,7 +1244,7 @@ jobs: |
1233 | 1244 | # ------------------------------------------------------------------ |
1234 | 1245 | update-filter-win: |
1235 | 1246 | 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 |
1237 | 1248 | runs-on: [ self-hosted, Windows, pyaedt ] |
1238 | 1249 | permissions: |
1239 | 1250 | actions: write # Needed to delete cache |
@@ -1319,7 +1330,7 @@ jobs: |
1319 | 1330 | # ------------------------------------------------------------------ |
1320 | 1331 | update-emit-win: |
1321 | 1332 | 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 |
1323 | 1334 | runs-on: [ self-hosted, Windows, pyaedt ] |
1324 | 1335 | permissions: |
1325 | 1336 | actions: write # Needed to delete cache |
|
0 commit comments