ci: Synchronize with sdk-nrf #1
This file contains hidden or 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: SDK Sync | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| workflow_dispatch: | |
| 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 }} | |
| 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: Rebase sdk-nrf onto main | |
| run: python scripts/sdk_sync/rebase_branch.py | |
| - name: Prepare test PR branch | |
| run: python scripts/sdk_sync/prepare_pr.py --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}" |