Skip to content

Commit 6528109

Browse files
authored
✅ CI check boards.h, pins.h (#27415)
1 parent b94a0d0 commit 6528109

File tree

6 files changed

+428
-222
lines changed

6 files changed

+428
-222
lines changed
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#
2+
# ci-validate-boards.yml
3+
# Validate boards.h to make sure it's all set up correctly
4+
#
5+
6+
name: CI - Validate boards.h
7+
8+
# We can do the on: section as two items, one for pull requests and one for pushes...
9+
on:
10+
pull_request:
11+
branches:
12+
- bugfix-2.1.x
13+
paths:
14+
- 'Marlin/src/core/boards.h'
15+
push:
16+
branches:
17+
- bugfix-2.1.x
18+
paths:
19+
- 'Marlin/src/core/boards.h'
20+
21+
jobs:
22+
validate_pins_files:
23+
name: Validate boards.h
24+
if: github.repository == 'MarlinFirmware/Marlin'
25+
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Check out the PR
30+
uses: actions/checkout@v4
31+
32+
- name: Cache pip
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cache/pip
36+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
37+
restore-keys: |
38+
${{ runner.os }}-pip-
39+
40+
- name: Select Python 3.9
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.9'
44+
architecture: 'x64'
45+
46+
- name: Validate core/boards.h
47+
run: |
48+
make validate-boards -j

.zed/settings.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Marlin-specific settings for Zed
3+
*
4+
* For a full list of overridable settings, and general information on folder-specific settings,
5+
* see the documentation: https://zed.dev/docs/configuring-zed#settings-files
6+
*/
7+
{
8+
"enable_language_servers": false
9+
}

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ UNIT_TEST_CONFIG ?= default
66

77
help:
88
@echo "Tasks for local development:"
9-
@echo "make marlin : Build marlin for the configured board"
9+
@echo "make marlin : Build Marlin for the configured board"
1010
@echo "make format-pins -j : Reformat all pins files (-j for parallel execution)"
1111
@echo "make validate-pins -j : Validate all pins files, fails if any require reformatting"
12+
@echo "make validate-boards -j : Validate boards.h and pins.h for standards compliance"
1213
@echo "make tests-single-ci : Run a single test from inside the CI"
1314
@echo "make tests-single-local : Run a single test locally"
1415
@echo "make tests-single-local-docker : Run a single test locally, using docker"
@@ -102,3 +103,11 @@ format-pins: $(PINS)
102103
validate-pins: format-pins
103104
@echo "Validating pins files"
104105
@git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1)
106+
107+
BOARDS_FILE := Marlin/src/core/boards.h
108+
109+
.PHONY: validate-boards
110+
111+
validate-boards:
112+
@echo "Validating boards.h file"
113+
@python $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)

0 commit comments

Comments
 (0)