Skip to content

Commit 4d85bce

Browse files
committed
Chaining of the workflows
1 parent 7809b17 commit 4d85bce

2 files changed

Lines changed: 15 additions & 20 deletions

File tree

.github/workflows/Build_RPS_AppKit-E8.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
push:
2323
branches: [main]
2424

25+
permissions:
26+
contents: read
27+
actions: read
28+
2529
jobs:
2630
CI:
2731
runs-on: ubuntu-latest
@@ -67,3 +71,8 @@ jobs:
6771
name: RPS_AppKit-E8-U85_HIL
6872
path: |
6973
./RockPaperScissors/AppKit-E8_USB/out
74+
75+
HARDWARE-RUN:
76+
needs: [ CI ]
77+
uses: ./.github/workflows/Run_RPS_AppKit-E8.yml
78+
secrets: inherit

.github/workflows/Run_RPS_AppKit-E8.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,31 @@
1717
name: Run RPS on AppKit-E8 Hardware
1818
on:
1919
workflow_dispatch:
20-
workflow_run:
21-
workflows: ["Build RPS for AppKit-E8 Hardware"]
22-
types: [completed]
23-
branches: [main]
20+
workflow_call:
2421

2522
permissions:
2623
contents: read
2724
actions: read
2825

2926
jobs:
30-
fork-restricted:
31-
name: Private runner restricted
32-
# trigger this only for forks, to prevent them from action runout
33-
if: ${{ github.repository != 'Arm-Examples/ModelNova' }}
27+
FORK-CHECK:
28+
if: ${{ github.repository != 'Arm-Examples/ModelNova' && github.event_name == 'workflow_dispatch' }}
3429
runs-on: ubuntu-latest
3530

3631
steps:
37-
- name: Notify runner restriction
32+
- name: Notify Runner Restriction
3833
run: |
3934
MESSAGE="Workflows on the private runner are restricted for security reasons."
40-
GUIDANCE="Contributors can validate changes using GitHub-hosted runners."
4135
echo "${MESSAGE}"
42-
echo "${GUIDANCE}"
4336
{
4437
echo "## ⚠️ AppKit-E8 hardware test was not run"
4538
echo ""
4639
echo "${MESSAGE}"
47-
echo ""
48-
echo "${GUIDANCE}"
4940
} >> "$GITHUB_STEP_SUMMARY"
5041
exit 1
5142
5243
CI:
53-
if: >-
54-
${{ (github.event_name == 'workflow_dispatch' ||
55-
(github.event.workflow_run.conclusion == 'success' &&
56-
github.event.workflow_run.head_repository.full_name == 'Arm-Examples/ModelNova')) }}
44+
if: ${{ ((github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) && github.repository == 'Arm-Examples/ModelNova') }}
5745
runs-on: [self-hosted, rsp-p5-01]
5846

5947
steps:
@@ -63,10 +51,8 @@ jobs:
6351
token: ${{ github.token }}
6452

6553
- name: Download Build Artifact
66-
if: ${{ github.event_name == 'workflow_run' }}
67-
uses: dawidd6/action-download-artifact@v17
54+
uses: actions/download-artifact@v8
6855
with:
69-
run_id: ${{ github.event.workflow_run.id }}
7056
name: RPS_AppKit-E8-U85_HIL
7157
path: ./RockPaperScissors/AppKit-E8_USB/out
7258

0 commit comments

Comments
 (0)