tests: refactor tests #1385
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: On PR action | |
on: | |
pull_request: | |
jobs: | |
Run_Configuration: | |
runs-on: ubuntu-24.04 | |
outputs: | |
NRF_revision: ${{ steps.config.outputs.NRF_revision }} | |
steps: | |
- name: Read body of PR | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{github.repository}}/pulls/${{github.event.number}} --jq '.body' > pr_body.md | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: install yq | |
run: pip install yq | |
- name: Get configuration | |
id: config | |
shell: bash {0} | |
run: | | |
csplit pr_body.md /\`\`\`yaml/1 | |
csplit xx01 /\`\`\`/ | |
mv xx00 configuration.yaml | |
cat configuration.yaml | |
revision=$(yq '.Github_actions.NRF_revision' configuration.yaml) | |
if [ $? != 0 ]; then | |
echo "Failed to read configuration use default main for NRF_revision" | |
echo "NRF_revision=main" >> $GITHUB_OUTPUT; | |
else | |
echo "NRF_revision=$revision" >> $GITHUB_OUTPUT; | |
fi; | |
- name: print nrf revision | |
run: | | |
echo ${{ steps.config.outputs.NRF_revision }} | |
verify_PR: | |
uses: ./.github/workflows/validate_code_style.yml | |
with: | |
reference_commit: ${{ github.event.pull_request.base.sha }} | |
save_pr_number: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Save PR number to file | |
run: | | |
echo "${{ github.event.number }}" > PR_number | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PR_number | |
path: | | |
PR_number | |
discover_target_boards: | |
runs-on: ubuntu-24.04 | |
outputs: | |
targets: ${{ steps.platforms.outputs.targets }} | |
steps: | |
- name: install yq | |
run: pip install yq | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: sidewalk | |
- name: get_platforms | |
id: platforms | |
run: | | |
result=$(yq '.common.platform_allow' sidewalk/samples/sid_end_device/sample.yaml -c) | |
echo "targets=$result" >> $GITHUB_OUTPUT; | |
echo "$result" | |
build_samples: | |
needs: [Run_Configuration, discover_target_boards] | |
uses: ./.github/workflows/samples_build.yml | |
with: | |
nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}} | |
boards_to_test: ${{needs.discover_target_boards.outputs.targets}} | |
build_and_run_tests: | |
needs: [Run_Configuration, discover_target_boards] | |
uses: ./.github/workflows/run_tests.yml | |
with: | |
nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}} | |
boards_to_test: ${{needs.discover_target_boards.outputs.targets}} |