Skip to content

Commit 1778d25

Browse files
committed
manifest: Auto update PR status
Update status of PR after target tests pass. Signed-off-by: Jorgen Kvalvaag <jorgen.kvalvaag@nordicsemi.no>
1 parent e86cd04 commit 1778d25

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

.github/workflows/ncsref-update.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ jobs:
2424
artifact_run_id: ${{ needs.build.outputs.run_id }}
2525
pytest_marker: not slow
2626
is_scheduled: false
27+
update-pr-state:
28+
needs: [build, test]
29+
runs-on: ubuntu-latest
30+
permissions:
31+
pull-requests: write
32+
steps:
33+
- name: Update PR state
34+
run: |
35+
PR_ID=$(gh pr list --repo ${{ github.repo }} | grep nrf-manifest-auto-branch | awk '{print $1}')
36+
gh pr review $PR_ID --approve --repo ${{ github.repo }}
37+
env:
38+
GH_TOKEN: ${{ github.token }}

.github/workflows/target-test.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ on:
2020
type: boolean
2121
required: false
2222
default: false
23+
nrfsdk_sha_update:
24+
type: boolean
25+
required: false
26+
default: false
2327

2428
workflow_dispatch:
2529
inputs:
@@ -54,12 +58,13 @@ jobs:
5458
run: |
5559
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
5660
matrix="${{ github.event.inputs.devices }}"
57-
else
58-
if [[ "${{ inputs.is_scheduled }}" == "true" ]]; then
61+
elif [[ "${{ inputs.is_scheduled }}" == "true" ]]; then
5962
matrix='["thingy91x","nrf9151dk"]'
60-
else
61-
matrix='["thingy91x"]'
62-
fi
63+
else
64+
matrix='["thingy91x"]'
65+
fi
66+
if [[ -z "$matrix" ]]; then
67+
matrix='["thingy91x"]'
6368
fi
6469
6570
echo "Matrix as string: $matrix"
@@ -80,12 +85,10 @@ jobs:
8085
runs-on: cia-trd-${{ matrix.device }}
8186
environment: ${{ matrix.device }}
8287
name: Target Test - ${{ matrix.device }}
83-
8488
permissions:
8589
actions: read
8690
contents: write
8791
packages: read
88-
8992
container:
9093
image: ghcr.io/nrfconnect/asset-tracker-template:test-docker-v1.0.1
9194
options: --privileged
@@ -108,8 +111,7 @@ jobs:
108111
- name: Download artifacts
109112
uses: actions/download-artifact@v4
110113
with:
111-
pattern: firmware-*
112-
merge-multiple: true
114+
name: firmware-artifacts-att
113115
path: asset-tracker-template/tests/on_target/artifacts
114116
run-id: ${{ inputs.artifact_run_id }}
115117
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -123,6 +125,8 @@ jobs:
123125
working-directory: asset-tracker-template/tests/on_target
124126
run: |
125127
pip install -r requirements.txt --break-system-packages
128+
apt update
129+
apt install -y --no-install-recommends gh
126130
127131
- name: Upload symbol file to Memfault
128132
if: ${{ matrix.device != 'ppk_thingy91x' }}

0 commit comments

Comments
 (0)