diff --git a/.github/workflows/Build_RPS_AppKit-E8.yml b/.github/workflows/Build_RPS_AppKit-E8.yml index 262ffd1..938f7cd 100644 --- a/.github/workflows/Build_RPS_AppKit-E8.yml +++ b/.github/workflows/Build_RPS_AppKit-E8.yml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Build RPS for AppKit-E8 Hardware +name: Build and Run RPS on AppKit-E8 Hardware on: workflow_dispatch: pull_request: @@ -22,6 +22,10 @@ on: push: branches: [main] +permissions: + contents: read + actions: read + jobs: CI: runs-on: ubuntu-latest @@ -67,3 +71,8 @@ jobs: name: RPS_AppKit-E8-U85_HIL path: | ./RockPaperScissors/AppKit-E8_USB/out + + HARDWARE-RUN: + needs: [ CI ] + uses: ./.github/workflows/Run_RPS_AppKit-E8.yml + secrets: inherit diff --git a/.github/workflows/Run_RPS_AppKit-E8.yml b/.github/workflows/Run_RPS_AppKit-E8.yml index dea636c..9d46202 100644 --- a/.github/workflows/Run_RPS_AppKit-E8.yml +++ b/.github/workflows/Run_RPS_AppKit-E8.yml @@ -16,19 +16,31 @@ name: Run RPS on AppKit-E8 Hardware on: - workflow_dispatch: - workflow_run: - workflows: ["Build RPS for AppKit-E8 Hardware"] - types: [completed] - branches: [main] + workflow_call: permissions: contents: read actions: read jobs: + RUNNER-GATE: + if: ${{ github.repository != 'Arm-Examples/ModelNova' && github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-latest + + steps: + - name: Notify Runner Restriction + run: | + MESSAGE="Workflows on the private runner are restricted for security reasons." + echo "${MESSAGE}" + { + echo "## ⚠️ AppKit-E8 hardware test was not run" + echo "" + echo "${MESSAGE}" + } >> "$GITHUB_STEP_SUMMARY" + exit 1 + CI: - if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success') }} + if: ${{ ((github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) && github.repository == 'Arm-Examples/ModelNova') }} runs-on: [self-hosted, rsp-p5-01] steps: @@ -38,10 +50,8 @@ jobs: token: ${{ github.token }} - name: Download Build Artifact - if: ${{ github.event_name == 'workflow_run' }} - uses: dawidd6/action-download-artifact@v17 + uses: actions/download-artifact@v8 with: - run_id: ${{ github.event.workflow_run.id }} name: RPS_AppKit-E8-U85_HIL path: ./RockPaperScissors/AppKit-E8_USB/out @@ -56,7 +66,7 @@ jobs: nohup pyocd run --uid L96807771A --cbuild-run SDS+AppKit-E8-U85.cbuild-run.yml --timelimit 30 --eot > pyocd.out 2>&1 & - name: Start the SDSIO server on the Raspberry Pi - working-directory: ./RockPaperScissors/AppKit-E8_USB + working-directory: ./RockPaperScissors/AppKit-E8_USB run: | sleep 2 # Delay to ensure that pyOCD is started sdsio-server --control SDS.sdsio.yml --playback --exit-after-playback --no-progress-info | tee sdsio-server.log