|
10 | 10 | - master |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - license-check: |
14 | | - runs-on: ubuntu-latest |
15 | | - container: |
16 | | - image: ghcr.io/armmbed/mbed-os-env:master-latest |
17 | | - |
18 | | - steps: |
19 | | - - name: Checkout repo |
20 | | - uses: actions/checkout@v2 |
21 | | - with: |
22 | | - fetch-depth: 0 |
23 | | - |
24 | | - - |
25 | | - name: install dependencies |
26 | | - shell: bash |
27 | | - run: | |
28 | | - pip install -U scancode-toolkit click |
29 | | -
|
30 | | - - |
31 | | - name: license check |
32 | | - run: | |
33 | | - set -x |
34 | | - mkdir -p SCANCODE |
35 | | - |
36 | | - git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \ |
37 | | - | ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true ) |
38 | | - echo $? |
39 | | - git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \ |
40 | | - | ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true ) \ |
41 | | - | ( grep -v '^tools/test/toolchains/api_test.py' || true ) \ |
42 | | - | while read file; do cp --parents "${file}" SCANCODE; done |
43 | | - ls SCANCODE |
44 | | - scancode -l --json-pp scancode.json SCANCODE |
45 | | - python ./tools/test/ci/scancode-evaluate.py scancode.json || true |
46 | | - cat scancode-evaluate.log |
47 | | - COUNT=$(cat scancode-evaluate.log | grep 'File:' | grep -v 'SPDX' | wc -l) || true |
48 | | - if [ $COUNT = 0 ]; then |
49 | | - echo "License check OK"; |
50 | | - true; |
51 | | - else |
52 | | - echo "License check failed, please review license issues found in files"; |
53 | | - false; |
54 | | - fi |
55 | | -
|
56 | | - include-check: |
57 | | - runs-on: ubuntu-latest |
58 | | - container: |
59 | | - image: ghcr.io/armmbed/mbed-os-env:master-latest |
60 | | - |
61 | | - steps: |
62 | | - - name: Checkout repo |
63 | | - uses: actions/checkout@v2 |
64 | | - with: |
65 | | - fetch-depth: 0 |
66 | | - |
67 | | - - |
68 | | - name: include check |
69 | | - run: | |
70 | | - # checks mbed.h is not included in MbedOS files except in tests |
71 | | - ! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \ |
72 | | - ':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \ |
73 | | - ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' \ |
74 | | - ':!*events/tests/*' ':!*drivers/tests/*' |
75 | | -
|
76 | | - style-check: |
77 | | - runs-on: ubuntu-latest |
78 | | - container: |
79 | | - image: ghcr.io/armmbed/mbed-os-env:master-latest |
80 | | - |
81 | | - steps: |
82 | | - |
83 | | - - name: Checkout repo |
84 | | - uses: actions/checkout@v2 |
85 | | - with: |
86 | | - fetch-depth: 0 |
87 | | - |
88 | | - - |
89 | | - name: UTF-8 Check |
90 | | - run: | |
91 | | - # Make sure we're not introducing any text which is not UTF-8 encoded |
92 | | - git diff origin/${GITHUB_BASE_REF} -U0 | ( grep -a '^+' || true ) | ( ! grep -axv '.*' ) |
93 | | - |
94 | | -
|
95 | | - - |
96 | | - name: astyle checks |
97 | | - run: | |
98 | | - set -x |
99 | | - git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \ |
100 | | - | ( grep '.*\.\(c\|cpp\|h\|hpp\)$' || true ) \ |
101 | | - | ( grep -v -f .codecheckignore || true ) \ |
102 | | - | while read file; do astyle -n --options=.astylerc "${file}"; done |
103 | | - git diff --exit-code --diff-filter=d --color |
104 | | -
|
105 | | -
|
106 | | - docs-check: |
107 | | - runs-on: ubuntu-latest |
108 | | - container: |
109 | | - image: ghcr.io/armmbed/mbed-os-env:master-latest |
110 | | - |
111 | | - steps: |
112 | | - |
113 | | - - name: Checkout repo |
114 | | - uses: actions/checkout@v2 |
115 | | - with: |
116 | | - fetch-depth: 0 |
117 | | - |
118 | | - - |
119 | | - name: spell checks |
120 | | - run: | |
121 | | - set -x |
122 | | - ./tools/test/ci/doxy-spellchecker/spell.sh drivers .codecheckignore |
123 | | - ./tools/test/ci/doxy-spellchecker/spell.sh platform .codecheckignore |
124 | | - ./tools/test/ci/doxy-spellchecker/spell.sh events .codecheckignore |
125 | | - ./tools/test/ci/doxy-spellchecker/spell.sh rtos .codecheckignore |
126 | | - ./tools/test/ci/doxy-spellchecker/spell.sh connectivity/netsocket .codecheckignore |
127 | | -
|
128 | | - - |
129 | | - name: doxygen |
130 | | - run: | |
131 | | - set -x |
132 | | - ccache -s |
133 | | - mkdir BUILD |
134 | | - # Assert that the Doxygen build produced no warnings. |
135 | | - # The strange command below asserts that the Doxygen command had an |
136 | | - # output of zero length |
137 | | - doxygen doxyfile_options 2>&1 |
138 | | - # Once Mbed OS has been fixed, enable the full test by replacing the top line with this: |
139 | | - # - ( ! doxygen doxyfile_options 2>&1 | grep . ) |
140 | | - # Assert that all binary libraries are named correctly |
141 | | - # The strange command below asserts that there are exactly 0 libraries |
142 | | - # that do not start with lib |
143 | | - find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" | |
144 | | - tee BUILD/badlibs | |
145 | | - sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ] |
146 | | - # Assert that all assembler files are named correctly |
147 | | - # The strange command below asserts that there are exactly 0 libraries |
148 | | - # that do end with .s |
149 | | - find -name "*.s" | tee BUILD/badasm | |
150 | | - sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ] |
151 | | -
|
152 | | - python-tests: |
153 | | - # these tests run in 3.7, hence running in vm not in pre-built docker |
154 | | - runs-on: ubuntu-latest |
155 | | - steps: |
156 | | - - |
157 | | - name: Checkout repo |
158 | | - uses: actions/checkout@v2 |
159 | | - |
160 | | - |
161 | | - - uses: actions/setup-python@v2 |
162 | | - with: |
163 | | - python-version: '3.7' |
164 | | - |
165 | | - - |
166 | | - name: install dependencies |
167 | | - run: | |
168 | | - pip install -r requirements.txt |
169 | | - pip install mock==2.0.0 attrs==19.1.0 pytest==3.3.0 'pylint>=1.9,<2' 'hypothesis>=3,<4' 'coverage>=4.5,<5' |
170 | | -
|
171 | | - - |
172 | | - name: pytest |
173 | | - run: | |
174 | | - set -x |
175 | | - coverage run -a -m pytest tools/test |
176 | | - python tools/test/pylint.py |
177 | | - coverage run -a tools/project.py -S | sed -n '/^Total/p' |
178 | | - coverage html |
179 | | -
|
180 | | - pin-validation: |
181 | | - runs-on: ubuntu-latest |
182 | | - container: |
183 | | - image: ghcr.io/armmbed/mbed-os-env:master-latest |
184 | | - steps: |
185 | | - - |
186 | | - name: Checkout repo |
187 | | - uses: actions/checkout@v2 |
188 | | - with: |
189 | | - fetch-depth: 0 |
190 | | - |
191 | | - - |
192 | | - name: validate pins |
193 | | - run: | |
194 | | - set -x |
195 | | - git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \ |
196 | | - | ( grep '.*[\\|\/]PinNames.h$' || true ) \ |
197 | | - | while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vvvfp "${file}"; done |
198 | | - git diff --exit-code --diff-filter=d --color |
199 | | -
|
200 | 13 | cmake-checks: |
201 | 14 | env: |
202 | 15 | NAME: mbed-test-mode-check |
@@ -239,42 +52,3 @@ jobs: |
239 | 52 | ls . |
240 | 53 | ls ./build |
241 | 54 |
|
242 | | - # Reject any changes to tools that would require a re-release of the |
243 | | - # tools for the online compiler. |
244 | | - frozen-tools-check: |
245 | | - runs-on: ubuntu-latest |
246 | | - container: |
247 | | - image: ghcr.io/armmbed/mbed-os-env:master-latest |
248 | | - steps: |
249 | | - - |
250 | | - name: Checkout repo |
251 | | - uses: actions/checkout@v2 |
252 | | - with: |
253 | | - fetch-depth: 0 |
254 | | - |
255 | | - - |
256 | | - name: frozen tool check |
257 | | - run: | |
258 | | - set -x |
259 | | - git diff --name-only origin/${GITHUB_BASE_REF} \ |
260 | | - | egrep \ |
261 | | - -e "^tools/build_api*" \ |
262 | | - -e "^tools/config*" \ |
263 | | - -e "^tools/export*" \ |
264 | | - -e "^tools/notifier*" \ |
265 | | - -e "^tools/paths*" \ |
266 | | - -e "^tools/resources*" \ |
267 | | - -e "^tools/targets*" \ |
268 | | - -e "^tools/toolchains*" \ |
269 | | - -e "^tools/utils*" \ |
270 | | - -e "^$" > output.log | true |
271 | | - frozen_files=`cat output.log` |
272 | | -
|
273 | | - if [ -z "$frozen_files" ]; then |
274 | | - echo "Success!"; |
275 | | - else |
276 | | - echo -e "Failure: Frozen files were modified\n$frozen_files"; |
277 | | - echo -e "Please see https://os.mbed.com/blog/entry/Introducing-the-new-Mbed-Tools/" \ |
278 | | - "\nfor why we've frozen the legacy tools."; |
279 | | - false; |
280 | | - fi |
0 commit comments