-
Notifications
You must be signed in to change notification settings - Fork 354
80 lines (69 loc) · 2.41 KB
/
Copy pathpr-check.yml
File metadata and controls
80 lines (69 loc) · 2.41 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
71
72
73
74
75
76
77
78
79
80
name: Packages PR Check
on:
pull_request:
branches:
- master
permissions: {}
concurrency:
group: packages-pr-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
detect-pull-request-packages:
if: ${{ github.repository == 'RT-Thread/packages' }}
runs-on: ubuntu-22.04
permissions:
contents: read
outputs:
packages: ${{ steps.changed-packages.outputs.packages }}
has-packages: ${{ steps.changed-packages.outputs.has-packages }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Detect changed packages
id: changed-packages
shell: bash
run: |
packages="$(python tools/ci/detect_changed_packages.py \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}")"
echo "packages=${packages}" >> "$GITHUB_OUTPUT"
if [ -n "$packages" ]; then
echo "has-packages=true" >> "$GITHUB_OUTPUT"
echo "Changed packages: $packages" >> "$GITHUB_STEP_SUMMARY"
else
echo "has-packages=false" >> "$GITHUB_OUTPUT"
echo "No package changes require package validation." >> "$GITHUB_STEP_SUMMARY"
fi
pull-request-package-validation:
needs: detect-pull-request-packages
if: ${{ github.repository == 'RT-Thread/packages' && needs.detect-pull-request-packages.outputs.has-packages == 'true' }}
runs-on: ubuntu-22.04
permissions:
contents: read
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install package checker dependencies
run: python -m pip install requests kconfiglib
- name: Validate changed package URLs, metadata, and Kconfig
shell: bash
env:
CHANGED_PACKAGES: ${{ needs.detect-pull-request-packages.outputs.packages }}
run: |
read -r -a packages <<< "$CHANGED_PACKAGES"
python ci.py --packages "${packages[@]}" --check-kconfig
tools-check:
if: ${{ github.repository == 'RT-Thread/packages' }}
permissions:
contents: read
uses: ./.github/workflows/aciont_tool.yml