diff --git a/.github/workflows/ports_psoc-edge-all.yml b/.github/workflows/ports_psoc-edge-all.yml new file mode 100644 index 00000000000..85e8cf553ec --- /dev/null +++ b/.github/workflows/ports_psoc-edge-all.yml @@ -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: + 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 diff --git a/.github/workflows/ports_psoc-edge-ifx.yml b/.github/workflows/ports_psoc-edge-ifx.yml index 5dce41e9358..6aea0b12d54 100644 --- a/.github/workflows/ports_psoc-edge-ifx.yml +++ b/.github/workflows/ports_psoc-edge-ifx.yml @@ -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