forked from nrfconnect/ncs-matter
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 2.33 KB
/
Copy pathsdk-sync.yml
File metadata and controls
70 lines (59 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: SDK Sync
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
inputs:
nrf_repo:
description: 'sdk-nrf repository (owner/name)'
required: false
default: 'ArekBalysNordic/sdk-nrf'
chip_repo:
description: 'sdk-connectedhomeip repository (owner/name)'
required: false
default: 'ArekBalysNordic/sdk-connectedhomeip'
push:
branches:
- sdk-nrf
permissions:
contents: write
pull-requests: write
jobs:
sdk-sync:
runs-on: ubuntu-24.04
env:
SDK_SYNC_PAT: ${{ secrets.SDK_SYNC_PAT }}
GH_TOKEN: ${{ secrets.SDK_SYNC_PAT }}
SDK_SYNC_NRF_REPO: ${{ inputs.nrf_repo || 'ArekBalysNordic/sdk-nrf' }}
SDK_SYNC_CHIP_REPO: ${{ inputs.chip_repo || 'ArekBalysNordic/sdk-connectedhomeip' }}
steps:
- name: Checkout the code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false
- name: Set state file path
run: echo "STATE_FILE=${RUNNER_TEMP}/sdk_sync_state.json" >> "$GITHUB_ENV"
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: scripts/sdk_sync/requirements.txt
- name: Install dependencies
run: pip install -r scripts/sdk_sync/requirements.txt
- name: Configure git credentials
run: |
git remote set-url origin "https://x-access-token:${SDK_SYNC_PAT}@github.com/${{ github.repository }}.git"
git config --global user.email "sdk-sync-bot@users.noreply.github.com"
git config --global user.name "sdk-sync-bot"
- name: Prepare test PR branch
run: python scripts/sdk_sync/prepare_pr.py --source-branch main --base-branch sdk-nrf --state-file "${STATE_FILE}"
- name: Collect upstream revision report
run: python scripts/sdk_sync/chip_sync_report.py --state-file "${STATE_FILE}"
- name: Update west.yml on PR branch
run: |
git checkout sdk-sync/test
python scripts/sdk_sync/update_manifest.py --state-file "${STATE_FILE}" --branch sdk-sync/test
- name: Post sync summary comment
run: python scripts/sdk_sync/build_report.py --state-file "${STATE_FILE}"