This repository was archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
64 lines (61 loc) · 2.54 KB
/
Copy pathpr-check_compliance.yaml
File metadata and controls
64 lines (61 loc) · 2.54 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
name: Check compliance
on:
pull_request:
paths:
- "**.c"
- "**.h"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
ncs:
name: Determine NCS version
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Get NCS version
id: version
run: echo "version=`node .github/ncs-version.js`" >> $GITHUB_OUTPUT
checkpatch:
runs-on: ubuntu-22.04
needs: [ncs]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Fetch all history for all tags and branches
run: git fetch --prune --tags
- name: Clone ci tools
run:
git clone https://github.com/zephyrproject-rtos/ci-tools ../ci-tools
- name: Install dependencies
run: |
python3 -m pip install --upgrade --user pip 'setuptools<58' urllib3 chardet
python3 -m pip install --upgrade --user wheel pylint junitparser
python3 -m pip install --upgrade --user -r ../ci-tools/requirements.txt
sudo apt-get install httpie jq gitlint
- name: Check compliance
env:
BUILD_NUMBER: ${{ github.event.pull_request.head.sha }}
GH_USERNAME: github-actions[bot]
run: |
export PATH=$PATH:/home/runner/.local/bin
curl -s https://raw.githubusercontent.com/nrfconnect/sdk-nrf/${{ needs.ncs.outputs.version }}/.checkpatch.conf > .checkpatch.conf
mkdir -p scripts/checkpatch
curl -s https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/${{ needs.ncs.outputs.version }}/scripts/checkpatch.pl > scripts/checkpatch.pl
chmod +x scripts/checkpatch.pl
curl -s https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/${{ needs.ncs.outputs.version }}/scripts/spelling.txt > scripts/spelling.txt
curl -s https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/${{ needs.ncs.outputs.version }}/scripts/checkpatch/typedefsfile > scripts/checkpatch/typedefsfile
../ci-tools/scripts/check_compliance.py -p ${{ github.event.pull_request.number }} \
-S ${{ github.event.pull_request.head.sha }} \
-g \
--commits origin/${{ github.event.pull_request.base.ref }}..HEAD \
--repo ${{ github.event.repository.full_name }}