From 0575013d3164ff53d19ab2dfd58fc263a4e3dbb7 Mon Sep 17 00:00:00 2001 From: SGudla Date: Tue, 26 Nov 2024 18:46:31 +0530 Subject: [PATCH] test config_json files Signed-off-by: SGudla --- .github/workflows/build-headless.yaml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-headless.yaml b/.github/workflows/build-headless.yaml index a7dc9f2e..16cadbf7 100644 --- a/.github/workflows/build-headless.yaml +++ b/.github/workflows/build-headless.yaml @@ -151,6 +151,17 @@ jobs: # name: ${{ matrix.project }} # path: ./build + - name: Read configuration from JSON + id: config + shell: bash + run: | + config=$(jq -r '.${{ matrix.project }}' config.json) + echo "::set-output name=serialport::$(echo $config | jq -r '.serialport')" + echo "::set-output name=device_name::$(echo $config | jq -r '.device_name')" + echo "::set-output name=platform_name::$(echo $config | jq -r '.platform_name')" + echo "::set-output name=serial_com_type::$(echo $config | jq -r '.serial_com_type')" + echo "::set-output name=drive_path::$(echo $config | jq -r '.drive_path')" + # - name: Copy artifact to hardware drive # run: | # echo "Programming the board" @@ -165,16 +176,8 @@ jobs: # copy .\build\${{ matrix.project }}.bin $drive_path # echo "Programmed the board" - - name: Read configuration from JSON - id: config - run: | - config=$(jq -r '.${{ matrix.project }}' config.json) - echo "::set-output name=serialport::$(echo $config | jq -r '.serialport')" - echo "::set-output name=device_name::$(echo $config | jq -r '.device_name')" - echo "::set-output name=platform_name::$(echo $config | jq -r '.platform_name')" - echo "::set-output name=serial_com_type::$(echo $config | jq -r '.serial_com_type')" - - name: Run tests + shell: bash run: | cd projects/${{ matrix.project }}/tests pytest -c pytest.ini --serialport "${{ steps.config.outputs.serialport }}" --device_name "${{ steps.config.outputs.device_name }}" --platform_name "${{ steps.config.outputs.platform_name }}" --serial_com_type "${{ steps.config.outputs.serial_com_type }}"