Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into mike-anet-evo
Browse files Browse the repository at this point in the history
* bugfix-2.1.x: (111 commits)
  [cron] Bump distribution date (2024-04-25)
  🩹 IA-Creality minor cleanup
  🩹 Simple IA-Creality babystep patch
  🚸 Fix duplicate temperature report (MarlinFirmware#26952)
  [cron] Bump distribution date (2024-04-24)
  ✏️ MPCTEMP_START => MPC_STARTED (MarlinFirmware#27002)
  🔧 BIQU MicroProbe V2 pull-up warning (MarlinFirmware#27008)
  🎨 Format pins which fail validation (MarlinFirmware#27007)
  ✅  CI - Validate Pins Formatting (MarlinFirmware#26996)
  [cron] Bump distribution date (2024-04-23)
  🎨 Clean up after recent PRs
  [cron] Bump distribution date (2024-04-22)
  🐛 Fix Flags<N> data storage width (MarlinFirmware#26995)
  ✅ Add additional unit tests for types.h (MarlinFirmware#26994)
  ✅ Unit test improvements (MarlinFirmware#26993)
  🔧 Add RAMPS TMC SPI pins when !TMC_USE_SW_SPI (MarlinFirmware#26960)
  🐛 Fix PID upon entering PID_FUNCTIONAL_RANGE (MarlinFirmware#26926)
  [cron] Bump distribution date (2024-04-21)
  🎨Match unit test folder structure to code (MarlinFirmware#26990)
  ✅ Skip compile tests when editing unit tests (MarlinFirmware#26991)
  ...
  • Loading branch information
mikezs committed Apr 26, 2024
2 parents 93b471a + af8dcc6 commit 3f61424
Show file tree
Hide file tree
Showing 344 changed files with 5,853 additions and 2,154 deletions.
40 changes: 0 additions & 40 deletions .github/lock.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/bump-date.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:

- name: Check out bugfix-2.0.x
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: bugfix-2.0.x

Expand All @@ -39,7 +39,7 @@ jobs:
exit 0
- name: Check out bugfix-2.1.x
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: bugfix-2.1.x

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# test-builds.yml
# ci-build-tests.yml
# Do test builds to catch compile errors
#

name: CI
name: CI - Build Tests

on:
pull_request:
Expand All @@ -14,6 +14,8 @@ on:
- config/**
- data/**
- docs/**
- test/**
- Marlin/tests/**
- '**/*.md'
push:
branches:
Expand All @@ -23,11 +25,13 @@ on:
- config/**
- data/**
- docs/**
- test/**
- Marlin/tests/**
- '**/*.md'

jobs:
test_builds:
name: Run All Tests
name: Build Test
if: github.repository == 'MarlinFirmware/Marlin'

runs-on: ubuntu-latest
Expand Down Expand Up @@ -152,21 +156,21 @@ jobs:
uses: actions/checkout@v4

- name: Cache pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Select Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/ci-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#
# ci-unit-tests.yml
# Build and execute unit tests to catch functional issues in code
#

name: CI - Unit Tests

on:
pull_request:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'
push:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'

jobs:
# This runs all unit tests as a single job. While it should be possible to break this up into
# multiple jobs, they currently run quickly and finish long before the compilation tests.
run_unit_tests:
name: Unit Test
# These tests will only be able to run on the bugfix-2.1.x branch, until the next release
# pulls them into additional branches.
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: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Select Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'

- name: Install PlatformIO
run: |
pip install -U platformio
pio upgrade --dev
pio pkg update --global
- name: Run All Unit Tests
run: |
make unit-test-all-local
51 changes: 51 additions & 0 deletions .github/workflows/ci-validate-pins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# ci-validate-pins.yml
# Validate that all of the pins files are unchanged by pinsformat.py
#

name: CI - Validate Pins Files

on:
pull_request:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths:
- 'Marlin/src/pins/*/**'
push:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths:
- 'Marlin/src/pins/*/**'

jobs:
validate_pins_files:
name: Validate Pins Files
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 all pins files
run: |
make validate-pins -j
2 changes: 1 addition & 1 deletion .github/workflows/clean-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- "Needs: Work"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Remove Labels
uses: actions-ecosystem/action-remove-labels@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/lock-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
process-only: 'issues'
issue-lock-inactive-days: '60'
issue-exclude-created-before: ''
issue-exclude-labels: 'no-locking'
issue-lock-labels: ''
issue-lock-comment: >
issue-inactive-days: '60'
exclude-issue-created-before: ''
exclude-any-issue-labels: 'no-locking'
add-issue-labels: ''
issue-comment: >
This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
Expand Down
42 changes: 36 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ SCRIPTS_DIR := buildroot/share/scripts
CONTAINER_RT_BIN := docker
CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
CONTAINER_IMAGE := marlin-dev
UNIT_TEST_CONFIG ?= default

help:
@echo "Tasks for local development:"
@echo "make marlin : Build marlin for the configured board"
@echo "make format-pins : Reformat all pins files"
@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"
@echo "make tests-single-local : Run a single test locally"
@echo "make tests-single-local-docker : Run a single test locally, using docker"
@echo "make tests-all-local : Run all tests locally"
@echo "make tests-all-local-docker : Run all tests locally, using docker"
@echo "make setup-local-docker : Build the local docker image"
@echo "make unit-test-single-local : Run unit tests for a single config locally"
@echo "make unit-test-single-local-docker : Run unit tests for a single config locally, using docker"
@echo "make unit-test-all-local : Run all code tests locally"
@echo "make unit-test-all-local-docker : Run all code tests locally, using docker"
@echo "make setup-local-docker : Setup local docker using buildx"
@echo ""
@echo "Options for testing:"
@echo " TEST_TARGET Set when running tests-single-*, to select the"
Expand All @@ -22,6 +28,9 @@ help:
@echo " run on GitHub CI"
@echo " ONLY_TEST Limit tests to only those that contain this, or"
@echo " the index of the test (1-based)"
@echo " UNIT_TEST_CONFIG Set the name of the config from the test folder, without"
@echo " the leading number. Default is 'default'". Used with the
@echo " unit-test-single-* tasks"
@echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value"
@echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
Expand All @@ -43,7 +52,7 @@ tests-single-local:
tests-single-local-docker:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"

tests-all-local:
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
Expand All @@ -52,14 +61,35 @@ tests-all-local:

tests-all-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)

unit-test-single-local:
platformio run -t marlin_$(UNIT_TEST_CONFIG) -e linux_native_test

unit-test-single-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-single-local UNIT_TEST_CONFIG=$(UNIT_TEST_CONFIG)

unit-test-all-local:
platformio run -t test-marlin -e linux_native_test

unit-test-all-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-all-local

setup-local-docker:
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
$(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .

PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')

.PHONY: $(PINS) format-pins validate-pins

$(PINS): %:
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@
@echo "Formatting $@"
@python $(SCRIPTS_DIR)/pinsformat.py $< $@

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)
Loading

0 comments on commit 3f61424

Please sign in to comment.