From 3938ec9481a818e0a241fbf198c7d204a4c9a704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Mon, 15 Apr 2024 08:05:06 +0000 Subject: [PATCH] ci: improve GHA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix size report generation, fetch PR body from CLI (allow change and rerun tests) merge jobs for creating PR in nrf Signed-off-by: Robert Gałat --- .github/pull_request_template.md | 10 ++++------ .github/workflows/on-pr.yml | 6 +++++- .github/workflows/on-pr_nrf_manifest_update_PR.yml | 5 +---- .github/workflows/run_tests.yml | 2 +- .github/workflows/samples_build.yml | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 85fa11c181..14e2eb8916 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,13 +9,11 @@ manifest-pr-skip (remove this line to create PR in NRF) JIRA ticket: -Detail description of the change ## Self review - [ ] There is no commented code. -- [ ] There is no TODO/FIXME comments without associated issue ticket. -- [ ] Commits are properly organized -- [ ] Verification - - [ ] Unit tests were updated to include the change. - - [ ] Change has been tested. +- [ ] There are no TODO/FIXME comments without associated issue ticket. +- [ ] Commits are properly organized. +- [ ] Change has been tested. +- [ ] Tests were updated (if applicable). diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index a5529c59b4..e46223ff3f 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -9,12 +9,16 @@ jobs: NRF_revision: ${{ steps.config.outputs.NRF_revision }} steps: - name: Read body of PR - run: printf "%s\n" "${{ github.event.pull_request.body }}" > pr_body.md + 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 - name: Get nrf revision id: config shell: bash {0} run: | + cat pr_body.md grep -oP "(NRF_revision=)[a-zA-Z0-9/_-]*" pr_body.md > config if [ $? != 0 ]; then echo "NRF_revision=main" >> $GITHUB_OUTPUT; diff --git a/.github/workflows/on-pr_nrf_manifest_update_PR.yml b/.github/workflows/on-pr_nrf_manifest_update_PR.yml index 866a919226..42c2516061 100644 --- a/.github/workflows/on-pr_nrf_manifest_update_PR.yml +++ b/.github/workflows/on-pr_nrf_manifest_update_PR.yml @@ -6,7 +6,7 @@ on: - main jobs: - github_context: + create-manifest-pr: runs-on: ubuntu-latest steps: - name: Print Github context @@ -14,9 +14,6 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - create-manifest-pr: - runs-on: ubuntu-latest - steps: - name: Create manifest PR uses: nrfconnect/action-manifest-pr@main with: diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index d0b9464e67..bc2bcd3153 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -58,7 +58,7 @@ jobs: - name: Twister build manual tests run: | source zephyr/zephyr-env.sh - west twister --testsuite-root sidewalk/tests/manual --inline-logs --overflow-as-errors --show-footprint --footprint-from-buildlog -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }} + west twister --testsuite-root sidewalk/tests/manual --inline-logs --overflow-as-errors --enable-size-report --show-footprint --footprint-from-buildlog -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }} - name: Prepare artifacts for upload run: | diff --git a/.github/workflows/samples_build.yml b/.github/workflows/samples_build.yml index fa11b2a611..d001c6a96e 100644 --- a/.github/workflows/samples_build.yml +++ b/.github/workflows/samples_build.yml @@ -58,7 +58,7 @@ jobs: - name: Twister build samples run: | source zephyr/zephyr-env.sh - west twister --testsuite-root sidewalk/samples/ --inline-logs --overflow-as-errors --show-footprint --footprint-from-buildlog -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }} + west twister --testsuite-root sidewalk/samples/ --inline-logs --overflow-as-errors --enable-size-report --show-footprint --footprint-from-buildlog -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }} - name: Prepare artifacts for upload run: |