99 artifact_fw_version :
1010 type : string
1111 required : true
12- pytest_marker :
13- type : string
12+ test_all :
13+ type : boolean
1414 required : false
15+ default : false
1516 pytest_path :
1617 type : string
1718 required : false
3233 description : The run ID of the workflow to fetch artifacts from
3334 type : string
3435 required : true
35- pytest_marker :
36- description : The pytest marker to run
37- type : string
36+ test_all :
37+ description : Run all tests
38+ type : boolean
3839 required : false
40+ default : false
3941 pytest_path :
4042 description : Select test execution path
4143 type : string
@@ -52,17 +54,28 @@ jobs:
5254 runs-on : ubuntu-latest
5355 outputs :
5456 device_matrix : ${{ steps.set-matrix.outputs.device_matrix }}
57+ pytest_marker : ${{ steps.set-matrix.outputs.pytest_marker }}
5558 steps :
5659 - id : set-matrix
5760 run : |
58- if [[ ${{ github.event_name == 'schedule' }} == "true" ]]; then
59- matrix='["thingy91x","nrf9151dk","ppk_thingy91x"]'
61+ if [[ ${{ github.event_name == 'schedule' }} == true ]]; then
62+ marker=''
63+ matrix='["thingy91x","nrf9151dk","ppk_thingy91x"]'
64+ elif [[ ${{ inputs.test_all }} == true ]]; then
65+ marker=''
66+ matrix='["thingy91x","nrf9151dk","ppk_thingy91x"]'
67+ elif [[ ${{ github.event_name == 'push' }} == true ]]; then
68+ marker='-m "not slow"'
69+ matrix='["thingy91x"]'
6070 else
61- matrix=${{ inputs.devices }}
71+ marker='-m "not slow"'
72+ matrix='["thingy91x"]'
6273 fi
6374
64- echo "Matrix as string: $matrix"
75+ echo Matrix as string: $matrix
76+ echo Pytest marker as string: $marker
6577 echo "device_matrix=$matrix" >> $GITHUB_OUTPUT
78+ echo "pytest_marker=$marker" >> $GITHUB_OUTPUT
6679
6780 target_test :
6881 # This will create multiple jobs, one for each target defined in the matrix
@@ -119,7 +132,7 @@ jobs:
119132 nrfutil install trace
120133
121134 - name : Upload symbol file to Memfault
122- if : ${{ matrix.device == 'thingy91x' }}
135+ if : ${{ matrix.device == 'thingy91x' && inputs.test_all }}
123136 working-directory : asset-tracker-template/tests/on_target/artifacts
124137 run : |
125138 memfault \
@@ -131,7 +144,7 @@ jobs:
131144 asset-tracker-template-${{ inputs.artifact_fw_version }}-debug-${{ vars.DUT_DEVICE_TYPE }}-nrf91.elf
132145
133146 - name : Generate and Push RAM and FLASH Badges
134- if : ${{ matrix.device == 'thingy91x' && inputs.is_scheduled }}
147+ if : ${{ matrix.device == 'thingy91x' && github.event_name == 'schedule' }}
135148 continue-on-error : true
136149 working-directory : asset-tracker-template
137150 env :
@@ -144,12 +157,12 @@ jobs:
144157 mkdir -p results
145158 if [[ '${{ matrix.device }}' == 'ppk_thingy91x' ]]; then
146159 # For PPK device, only run tests/test_ppk
147- pytest -v ${{ inputs .pytest_marker }} \
160+ pytest -v ${{ needs.set-matrix.outputs .pytest_marker }} \
148161 --junit-xml=results/test-results.xml \
149162 --html=results/test-results.html --self-contained-html \
150163 tests/test_ppk
151164 else
152- pytest -v ${{ inputs .pytest_marker }} \
165+ pytest -v ${{ needs.set-matrix.outputs .pytest_marker }} \
153166 --junit-xml=results/test-results.xml \
154167 --html=results/test-results.html --self-contained-html \
155168 --ignore=tests/test_ppk \
0 commit comments