Skip to content

Linux "Hardware-in-the-Loop" Tests #7

Linux "Hardware-in-the-Loop" Tests

Linux "Hardware-in-the-Loop" Tests #7

Workflow file for this run

name: Linux "Hardware-in-the-Loop" Tests
on:
workflow_dispatch:
inputs:
api-url:
required: true
type: string
api-key-id:
required: true
type: string
coap_gateway_url:
required: true
type: string
workflow_call:
inputs:
api-url:
required: true
type: string
api-key-id:
required: true
type: string
coap_gateway_url:
required: true
type: string
jobs:
hil:
name: linux-hil-tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
path: .
submodules: 'recursive'
- name: Compile
shell: bash
run: |
rm -rf test_binaries
mkdir -p test_binaries
export EXTRA_BUILD_ARGS=-DCONFIG_GOLIOTH_COAP_HOST_URI=${{ inputs.coap_gateway_url }}
for test in `ls tests/hil/tests`
do
cmake -B build -S tests/hil/platform/linux $EXTRA_BUILD_ARGS -DGOLIOTH_HIL_TEST=$test
make -j8 -C build
mv build/hil test_binaries/${test}-test
done
- name: Setup Python dependencies
run: |
pip install --upgrade pip
pip install pytest pytest-timeout
pip install tests/hil/scripts/pytest-hil
pip install git+https://github.com/golioth/python-golioth-tools@9558b52139c3f75541ee4de1c71acf679eb41f23
- name: Run test
shell: bash
run: |
for test in `ls tests/hil/tests`
do
pytest --rootdir . tests/hil/tests/$test \
--board linux \
--fw-image test_binaries/${test}-test \
--api-url ${{ inputs.api-url }} \
--api-key ${{ secrets[inputs.api-key-id] }} \
--mask-secrets \
-rP \
--timeout=600
done