Skip to content
Draft
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
82 changes: 82 additions & 0 deletions .github/workflows/ports_psoc-edge-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: psoc-edge port ifx all tests

on:
workflow_dispatch:
schedule:
# GitHub Actions schedules use UTC. 17:00 UTC = 18:00 CET.
- cron: '0 17 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
mpy_hex_file: firmware.hex

jobs:
server-build:
runs-on: ubuntu-latest
strategy:
matrix:
board:
- KIT_PSE84_AI
outputs:
commit_sha: ${{ steps.commit_sha.outputs.sha_short }}

steps:
- uses: actions/checkout@v6
- name: Install packages
run: source tools/ci.sh && ci_psoc_edge_setup
- name: Build
run: source tools/ci.sh && ci_psoc_edge_build ${{ matrix.board }}
- name: Gets commit SHA
if: success()
id: commit_sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Save firmware bin
if: success()
uses: actions/upload-artifact@v4
with:
name: mpy-psoc-edge_${{ matrix.board }}_${{ steps.commit_sha.outputs.sha_short }}
path: ports/psoc-edge/build-${{ matrix.board }}/${{ env.mpy_hex_file }}

on-target-test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +18 to +43
runs-on:
- self-hosted
- Linux
- PSOC-EDGE
needs: server-build
strategy:
matrix:
board:
- KIT_PSE84_AI
steps:
- name: Fix permissions
run: echo ${{ secrets.SELF_HOSTED_PASSWORD }} | sudo -S chown -R $(whoami):$(whoami) .
- name: Checkout code
uses: actions/checkout@v6
- name: Download binaries
uses: actions/download-artifact@v4
- name: Container setup
run: |
echo ${{ secrets.SELF_HOSTED_PASSWORD }} | sudo -S chmod 666 /var/run/docker.sock
source tools/ci.sh && ci_psoc_edge_setup_hil ${{ matrix.board }}
- name: Setup devices
run: |
cp mpy-psoc-edge_${{ matrix.board }}_${{ needs.server-build.outputs.commit_sha }}/${{ env.mpy_hex_file }} tools/psoc-edge
source tools/ci.sh && ci_psoc_edge_deploy_hil ${{ matrix.board }} ${{ env.mpy_hex_file }} tests/ports/psoc-edge/${{ runner.name }}-devs.yml
- name: Run all tests
env:
pse_test_dir: tests/ports/psoc-edge
run: |
devs_file=$pse_test_dir/${{ runner.name }}-devs.yml
# TODO: Select the UART target via feature query once etdevs-query supports it.
target_uid=101A1398012D2400

target_port=$(etdevs-query address --filter uid=$target_uid --devs-yml $devs_file | head -1)
cd tests
python -u run-tests.py -t $target_port
- name: Container teardown
if: always()
run: |
source tools/ci.sh && ci_psoc_edge_teardown_hil

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +44 to +82
22 changes: 22 additions & 0 deletions .github/workflows/ports_psoc-edge-ifx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,28 @@ jobs:
--test-plan $pse_test_dir/test-plan.yml \
--hil-devs $pse_test_dir/${{ runner.name }}-devs.yml

- name: Run all tests
env:
pse_test_dir: tests/ports/psoc-edge
run: |
devs_file=$pse_test_dir/${{ runner.name }}-devs.yml
# TODO: Select the UART target via feature query once etdevs-query supports it.
target_uid=101A1398012D2400

target_port=$(etdevs-query address --filter uid=$target_uid --devs-yml $devs_file | head -1)
cd tests
for attempt in 1 2 3; do
if [ "$attempt" -eq 1 ]; then
python -u run-tests.py -t $target_port && break
else
python -u run-tests.py -t $target_port --run-failures && break
fi

if [ "$attempt" -eq 3 ]; then
exit 1
fi
done

- name: Remove decrypted Wi-Fi secrets
if: ${{ always() && hashFiles('tests/ports/psoc-edge/mp_custom/secrets.py.gpg') != '' }}
run: rm -f tests/ports/psoc-edge/mp_custom/secrets.py
Expand Down
Loading