Skip to content

Commit 95eaeef

Browse files
GHA: update gha scripts
update actions Signed-off-by: Robert Gałat <[email protected]>
1 parent bff3885 commit 95eaeef

File tree

9 files changed

+22
-175
lines changed

9 files changed

+22
-175
lines changed

.github/workflows/on-pr.yml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,6 @@ on:
33
pull_request:
44

55
jobs:
6-
Run_Configuration:
7-
runs-on: ubuntu-24.04
8-
outputs:
9-
NRF_revision: ${{ steps.config.outputs.NRF_revision }}
10-
steps:
11-
- name: Read body of PR
12-
env:
13-
GH_TOKEN: ${{ github.token }}
14-
run: |
15-
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
16-
17-
- uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.9'
20-
21-
- name: install yq
22-
run: pip install yq
23-
24-
- name: Get configuration
25-
id: config
26-
shell: bash {0}
27-
run: |
28-
csplit pr_body.md /\`\`\`yaml/1
29-
csplit xx01 /\`\`\`/
30-
mv xx00 configuration.yaml
31-
cat configuration.yaml
32-
revision=$(yq '.Github_actions.NRF_revision' configuration.yaml)
33-
if [ $? != 0 ]; then
34-
echo "Failed to read configuration use default main for NRF_revision"
35-
echo "NRF_revision=main" >> $GITHUB_OUTPUT;
36-
else
37-
echo "NRF_revision=$revision" >> $GITHUB_OUTPUT;
38-
fi;
39-
40-
- name: print nrf revision
41-
run: |
42-
echo ${{ steps.config.outputs.NRF_revision }}
436

447
verify_PR:
458
uses: ./.github/workflows/validate_code_style.yml
@@ -82,15 +45,13 @@ jobs:
8245
echo "$result"
8346
8447
build_samples:
85-
needs: [Run_Configuration, discover_target_boards]
48+
needs: [discover_target_boards]
8649
uses: ./.github/workflows/samples_build.yml
8750
with:
88-
nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}}
8951
boards_to_test: ${{needs.discover_target_boards.outputs.targets}}
9052

9153
build_and_run_tests:
92-
needs: [Run_Configuration, discover_target_boards]
54+
needs: [discover_target_boards]
9355
uses: ./.github/workflows/run_tests.yml
9456
with:
95-
nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}}
9657
boards_to_test: ${{needs.discover_target_boards.outputs.targets}}

.github/workflows/on-pr_nrf_manifest_update_PR.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/on_docker_change.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ jobs:
5353
- name: Get revision of nrf to use
5454
id: revision
5555
run: |
56-
REF_NAME="${{ github.ref_name }}"
57-
if [ -z "$REF_NAME" ]; then
58-
REF_NAME="main" # Set your default value here
59-
fi
56+
REF_NAME=$(yq '.manifest.projects | map(select(.name == "nrf"))[0].revision' tmp_west.yml)
6057
echo "REF_NAME=$REF_NAME" >> $GITHUB_OUTPUT
6158
echo "Ref name: $REF_NAME"
6259

.github/workflows/run_tests.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Build Sidewalk samples
22
on:
33
workflow_call:
44
inputs:
5-
nrf_revision:
6-
type: string
7-
required: false
8-
default: "main"
95
boards_to_test:
106
type: string
117
required: true
@@ -30,16 +26,9 @@ jobs:
3026

3127
- name: update NRF
3228
run: |
33-
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. &&
34-
cp -r /workdir/nrf nrf;
35-
west init -l nrf &&
36-
cd nrf &&
37-
git fetch origin ${{inputs.nrf_revision}}:PR-branch &&
38-
git checkout PR-branch &&
39-
cd .. &&
40-
west config manifest.group-filter +sidewalk &&
41-
west update -n -o=--depth=1 --path-cache /workdir/ &&
42-
cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash
29+
rm -rf .west;
30+
west init -l sidewalk --mf tmp_west.yml &&
31+
west update -n -o=--depth=1 --path-cache /workdir/
4332
4433
- name: Install Python dependencies
4534
run: |
@@ -95,7 +84,6 @@ jobs:
9584
max_subsets: 2
9685
run_tests: true
9786
target_board: ${{ matrix.board }}
98-
nrf_revision: ${{ inputs.nrf_revision }}
9987

10088
merge_tests_on_hw:
10189
needs: build-and-test_on_hw

.github/workflows/run_tests_cli.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,9 @@ jobs:
3434

3535
- name: update NRF
3636
run: |
37-
rm -rf .west nrf;
38-
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd ..
39-
west init -m https://github.com/nrfconnect/sdk-nrf --mr main . &&
40-
cd nrf &&
41-
git fetch origin ${{inputs.nrf_revision}}:branch_to_run &&
42-
git checkout branch_to_run &&
43-
git rev-parse HEAD &&
44-
cd .. &&
45-
west config manifest.group-filter +sidewalk &&
46-
west update -n -o=--depth=1 --path-cache /workdir/ &&
47-
cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash
37+
rm -rf .west;
38+
west init -l sidewalk --mf tmp_west.yml &&
39+
west update -n -o=--depth=1 --path-cache /workdir/
4840
4941
- name: Replace slash with underscore
5042
id: replace
@@ -102,5 +94,4 @@ jobs:
10294
if: always()
10395
run: |
10496
rm -rf pytest-sidewalk
105-
cd nrf; git checkout main; git branch -D branch_to_run;
10697
rm -rf PACKAGE_ARTIFACTS_* twister-out

.github/workflows/run_tests_dut.yml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Build and run DUT tests
22
on:
33
workflow_call:
44
inputs:
5-
nrf_revision:
6-
type: string
7-
required: false
8-
default: "main"
95
subset:
106
description: ""
117
required: true
@@ -44,18 +40,9 @@ jobs:
4440

4541
- name: update NRF
4642
run: |
47-
rm -rf .west nrf;
48-
cp -r /workdir/nrf nrf;
49-
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. &&
50-
west init -l nrf &&
51-
cd nrf &&
52-
git fetch origin ${{inputs.nrf_revision}}:branch_to_run &&
53-
git checkout branch_to_run &&
54-
git rev-parse HEAD &&
55-
cd .. &&
56-
west config manifest.group-filter +sidewalk &&
57-
west update -n -o=--depth=1 --path-cache /workdir/ &&
58-
cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash
43+
rm -rf .west;
44+
west init -l sidewalk --mf tmp_west.yml &&
45+
west update -n -o=--depth=1 --path-cache /workdir/
5946
6047
- name: Install Python dependencies
6148
run: |
@@ -116,18 +103,9 @@ jobs:
116103

117104
- name: update NRF
118105
run: |
119-
rm -rf .west nrf;
120-
cp -r /workdir/nrf nrf;
121-
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. &&
122-
west init -l nrf &&
123-
cd nrf &&
124-
git fetch origin ${{inputs.nrf_revision}}:branch_to_run &&
125-
git checkout branch_to_run &&
126-
git rev-parse HEAD &&
127-
cd .. &&
128-
west config manifest.group-filter +sidewalk &&
129-
west update -n -o=--depth=1 --path-cache /workdir/ &&
130-
cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash
106+
rm -rf .west;
107+
west init -l sidewalk --mf tmp_west.yml &&
108+
west update -n -o=--depth=1 --path-cache /workdir/
131109
132110
- name: Replace slash with underscore
133111
id: replace

.github/workflows/samples_build.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Build Sidewalk samples
22
on:
33
workflow_call:
44
inputs:
5-
nrf_revision:
6-
type: string
7-
required: false
8-
default: "main"
95
save_images:
106
type: boolean
117
required: false
@@ -43,17 +39,10 @@ jobs:
4339

4440
- name: update NRF
4541
run: |
46-
rm -rf .west nrf;
47-
cp -r /workdir/nrf nrf;
48-
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. &&
49-
west init -l nrf &&
50-
cd nrf &&
51-
git fetch origin ${{inputs.nrf_revision}}:PR-branch &&
52-
git checkout PR-branch &&
53-
cd .. &&
54-
west config manifest.group-filter +sidewalk &&
55-
west update -n -o=--depth=1 --path-cache /workdir/ &&
56-
cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash
42+
rm -rf .west;
43+
west init -l sidewalk --mf tmp_west.yml &&
44+
west config -l &&
45+
west update -n -o=--depth=1 --path-cache /workdir/
5746
5847
- name: Install Python dependencies
5948
run: |

.github/workflows/validate_code_style.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ jobs:
6060

6161
- name: update NRF
6262
run: |
63-
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash; cd ..
64-
west init -m https://github.com/nrfconnect/sdk-nrf --mr main .
65-
west config manifest.group-filter +sidewalk
63+
rm -rf .west;
64+
west init -l sidewalk --mf tmp_west.yml &&
6665
west update -n -o=--depth=1 --path-cache /workdir/
67-
cd sidewalk; git checkout `cat /workdir/sidewalk_hash`; rm -rf /workdir/sidewalk_hash
6866
6967
- name: Run Compliance Tests
7068
run: |

scripts/ci/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ autopep8>=2.0.1
33
ruamel.yaml>=0.17.21
44
clang-format
55
yamllint>=1.32.0
6+
yq>=3.4.3

0 commit comments

Comments
 (0)