Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» CI check boards.h , pins.h
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 10, 2024
1 parent b94a0d0 commit d023e59
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 144 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci-validate-boards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# ci-validate-boards.yml
# Validate boards.h to make sure it's all set up correctly
#

name: CI - Validate boards.h

# We can do the on: section as two items, one for pull requests and one for pushes...
on:
pull_request:
branches:
- bugfix-2.1.x
paths:
- 'Marlin/src/core/boards.h'
push:
branches:
- bugfix-2.1.x
paths:
- 'Marlin/src/core/boards.h'

jobs:
validate_pins_files:
name: Validate boards.h
if: github.repository == 'MarlinFirmware/Marlin'

runs-on: ubuntu-latest

steps:
- name: Check out the PR
uses: actions/checkout@v4

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Select Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'

- name: Validate core/boards.h
run: |
make validate-boards -j
7 changes: 7 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Marlin-specific settings for Zed
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"enable_language_servers": false
}
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ UNIT_TEST_CONFIG ?= default

help:
@echo "Tasks for local development:"
@echo "make marlin : Build marlin for the configured board"
@echo "make marlin : Build Marlin for the configured board"
@echo "make format-pins -j : Reformat all pins files (-j for parallel execution)"
@echo "make validate-pins -j : Validate all pins files, fails if any require reformatting"
@echo "make tests-single-ci : Run a single test from inside the CI"
Expand Down Expand Up @@ -102,3 +102,11 @@ format-pins: $(PINS)
validate-pins: format-pins
@echo "Validating pins files"
@git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1)

BOARDS_FILE := Marlin/src/core/boards.h

.PHONY: validate-boards

validate-boards:
@echo "Validating boards.h file"
@python $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)
Loading

0 comments on commit d023e59

Please sign in to comment.