forked from nrfconnect/sdk-sidewalk
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (68 loc) · 2.25 KB
/
on-pr.yml
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
81
name: on PR action
on:
pull_request:
branches:
- main
jobs:
validate_code_compliance:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install requirements
run: |
python3 -m pip install -r ./scripts/ci/requirements.txt
- name: Check formatting
run: |
python3 ./scripts/ci/verify_formatting.py -d -s . -c ./scripts/ci/formatter_cfg.yml
- name: Check license
run: |
python3 ./scripts/ci/verify_license.py -s . -c ./scripts/ci/license.yml
validate_compliance_with_zephyr:
runs-on: ubuntu-latest
container:
image: ghcr.io/nrfconnect/sdk-sidewalk:main
options: --cpus 2
defaults:
run:
shell: nrfutil toolchain-manager launch --install-dir /root/ncs bash -- {0}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run Compliance Tests
env:
BASE_REF: ${{ github.base_ref }}
run: |
source /workdir/zephyr/zephyr-env.sh
cp -r ../sdk-sidewalk /workdir/sidewalk_internal
ln -s /workdir/sidewalk_internal /workdir/sidewalk
cd /workdir/sidewalk
python3 scripts/ci/sid_compliance.py --annotate -m yamllint -m kconfigbasic -m devicetreebindings -m binaryfiles -m imagesize -m nits -m gitlint -m identity -c origin/${BASE_REF}..
save_pr_number:
runs-on: ubuntu-latest
steps:
- name: Save PR number to file
run: |
echo "${{ github.event.number }}" > PR_number
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: PR_number
path: |
PR_number
build_samples_and_tests:
needs: [validate_code_compliance, validate_compliance_with_zephyr]
uses: ./.github/workflows/common-build.yml
run_dut_unit_tests:
needs: [build_samples_and_tests]
uses: ./.github/workflows/common_run_dut_ut.yml
publish_test_results:
needs: [run_dut_unit_tests]
uses: ./.github/workflows/publish_test_results.yml