Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: CHERIoT Network-Stack CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
Expand All @@ -15,13 +14,13 @@ on:
jobs:
check-format:
name: Check coding conventions
runs-on: ubuntu-latest
runs-on: the-capable-hub-aws-ci
container:
image: ghcr.io/cheriot-platform/devcontainer:latest
options: --user 1001
options: --user 1000
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
- name: Check out RTOS
Expand All @@ -34,18 +33,17 @@ jobs:
strategy:
matrix:
build-type: [ debug, release ]
board: [ibex-arty-a7-100, sonata-0.2, sonata-1.1]
board: [sonata-1.3]
include:
- xmake-run: false
- build-type: debug
build-flags: --debug-loader=y --debug-scheduler=y --debug-allocator=information --allocator-rendering=y -m debug
- build-type: release
build-flags: --debug-loader=n --debug-scheduler=n --debug-allocator=none -m release --stack-usage-check-allocator=y --stack-usage-check-scheduler=y
fail-fast: false
runs-on: ubuntu-latest
runs-on: the-capable-hub-aws-ci
container:
image: ${{ inputs.devcontainer || 'ghcr.io/cheriot-platform/devcontainer:latest' }}
options: --user 1001
options: --user 1000
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
Expand All @@ -60,11 +58,18 @@ jobs:
for d in examples/*/; do (
cd $d
xmake f --sdk=/cheriot-tools/ --board=${{matrix.board}} ${{ matrix.build-flags }}
xmake
xmake run
); done
- name: Upload firmware artifacts
if: matrix.board == 'sonata-1.3' && matrix.build-type == 'release'
uses: actions/upload-artifact@v7
with:
name: sonata-firmware
path: examples/*/build/**/firmware.uf2
if-no-files-found: error
all-checks:
needs: [check-format,build-examples]
runs-on: ubuntu-latest
runs-on: the-capable-hub-aws-ci
steps:
- name: Dummy step
run: true
88 changes: 46 additions & 42 deletions .github/workflows/sonata-hil-ci.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,52 @@
name: CHERIoT Network-Stack HIL-CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_run:
workflows: ["CHERIoT Network-Stack CI"]
types: [completed]
workflow_dispatch:
inputs:
devcontainer:
description: 'Set to override default build container'
run-id:
description: 'main.yml workflow run ID to download firmware from'
type: string
required: false
required: true

jobs:
build-examples:
name: Build Example Projects
runs-on: ubuntu-latest
container:
image: ${{ inputs.devcontainer || 'ghcr.io/cheriot-platform/devcontainer:latest' }}
options: --user 1001
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6
with:
submodules: recursive

- name: Check out RTOS
run: |
cd ..
git clone --recurse https://github.com/cheriot-platform/cheriot-rtos

- name: Build examples for Sonata
run: |
for d in examples/*/; do (
cd $d
xmake f --sdk=/cheriot-tools/ --board=sonata-1.3 -m release --IPv6=false
xmake run
); done

- name: Upload firmware artifacts
uses: actions/upload-artifact@v7
with:
name: sonata-firmware
path: examples/*/build/**/firmware.uf2
if-no-files-found: error

hardware-test:
name: Hardware Test on Sonata
needs: build-examples
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
runs-on: [ the-capable-hub-farm, board:Sonata ]
environment: hil-hardware # Requires you to create this environment in settings
permissions:
statuses: write
actions: read
contents: read

steps:
- name: Set PR status to pending
if: github.event_name == 'workflow_run'
uses: actions/github-script@v7
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
state: 'pending',
context: 'HIL Tests (Sonata)',
description: 'Awaiting hardware testing...'
})

- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v4

- name: Download firmware artifacts
uses: actions/download-artifact@v7
uses: actions/download-artifact@v4
with:
name: sonata-firmware
path: firmware
run-id: ${{ github.event_name == 'workflow_dispatch' && inputs.run-id || github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Mount Sonata
run: |
Expand All @@ -76,3 +65,18 @@ jobs:

- name: Flash and test all examples
run: bash .github/sonata-hil/run-hil-tests.sh

- name: Update PR status
if: always() && github.event_name == 'workflow_run'
uses: actions/github-script@v7
with:
script: |
const state = '${{ job.status }}' === 'success' ? 'success' : 'failure';
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
state: state,
context: 'HIL Tests (Sonata)',
description: `Hardware tests finished with status: ${state}`
})
Loading