Skip to content

Commit

Permalink
Check that each supported board is mentioned in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
reznikmm committed Dec 1, 2023
1 parent cb52f70 commit a1038d2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:

- run: python3 $PWD/scripts/build_all_examples.py
- run: python3 $PWD/testsuite/run.py
- run: python3 $PWD/scripts/check_readme.py

win-build:
name: Build and test on Windows
Expand Down
37 changes: 37 additions & 0 deletions scripts/check_readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /usr/bin/env python3

import os
import sys
import config
import config.user_input.console
from build_all_examples import run_program

from config.boards import list_of_boards

script_dir = os.path.dirname(__file__)
ADL_root_dir = os.path.abspath(os.path.join(script_dir, ".."))
top_readme_file = os.path.join(ADL_root_dir, "README.md")

undocumented = []

error = \
"""Next boards were not mentioned in the top README.md file!
Please, append each of them to the table in the Board List section.
"""

with open(top_readme_file, 'r', encoding='utf-8') as file:
lines = [line for line in file]

# No error on Custom_Board:
lines.append("[Custom_Board]")

for board in list_of_boards():
text = f"[{board}]"
found = [line for line in lines if text in line]
if not found:
undocumented.append(board)

if undocumented:
print(error)
print(undocumented)
sys.exit(1)

0 comments on commit a1038d2

Please sign in to comment.