Skip to content

Commit 503ec28

Browse files
committed
Check that each supported board is mentioned in README.md
1 parent 22ae2ae commit 503ec28

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232

3333
- run: python3 $PWD/scripts/build_all_examples.py
3434
- run: python3 $PWD/testsuite/run.py
35+
- run: python3 $PWD/scripts/check_readme.py
3536

3637
win-build:
3738
name: Build and test on Windows

scripts/check_readme.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#! /usr/bin/env python3
2+
3+
import os
4+
import sys
5+
import config
6+
import config.user_input.console
7+
from build_all_examples import run_program
8+
9+
from config.boards import list_of_boards
10+
11+
script_dir = os.path.dirname(__file__)
12+
ADL_root_dir = os.path.abspath(os.path.join(script_dir, ".."))
13+
top_readme_file = os.path.join(ADL_root_dir, "README.md")
14+
15+
undocumented = []
16+
17+
error = \
18+
"""Next boards were not mentioned in the top README.md file!
19+
Please, append each of them to the table in the Board List section.
20+
"""
21+
22+
with open(top_readme_file, 'r', encoding='utf-8') as file:
23+
lines = [line for line in file]
24+
25+
# No error on Custom_Board:
26+
lines.append("[Custom_Board]")
27+
28+
for board in list_of_boards():
29+
text = f"[{board}]"
30+
found = [line for line in lines if text in line]
31+
if not found:
32+
undocumented.append(board)
33+
34+
if undocumented:
35+
print(error)
36+
print(undocumented)
37+
sys.exit(1)

0 commit comments

Comments
 (0)