diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..e3e6757 --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,63 @@ +# Compiles every sketch in examples/ on each push and pull request, so a change +# that breaks the library (or an example) is caught before it lands. This is the +# floor of CI for this published Arduino library; off-device unit tests for the +# pure-logic classes (MovingAverageFilter, Shape collision, ColorName) are a +# planned follow-up. +# +# Uses the official arduino/compile-sketches action. +name: Compile Examples + +on: + push: + paths: + - "src/**" + - "examples/**" + - ".github/workflows/compile-examples.yml" + pull_request: + paths: + - "src/**" + - "examples/**" + - ".github/workflows/compile-examples.yml" + # Allow manual runs from the Actions tab. + workflow_dispatch: + +jobs: + compile: + name: ${{ matrix.board.fqbn }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + board: + # The verified floor (see CLAUDE.md). To extend coverage, add entries + # here once confirmed compiling, e.g.: + # - fqbn: esp32:esp32:esp32 + # platform-name: esp32:esp32 + # platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json + - fqbn: arduino:avr:uno + platform-name: arduino:avr + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + fqbn: ${{ matrix.board.fqbn }} + platforms: | + - name: ${{ matrix.board.platform-name }} + # Install this repo as a library (source-path: ./) alongside the + # Adafruit dependencies the examples need. Adafruit SSD1306 pulls in + # Adafruit GFX and Adafruit BusIO, but we list them explicitly so a + # dependency resolution change upstream can't silently break the build. + libraries: | + - source-path: ./ + - name: Adafruit SSD1306 + - name: Adafruit GFX Library + - name: Adafruit BusIO + sketch-paths: | + - examples + enable-warnings-report: true + verbose: false diff --git a/src/Button.hpp b/src/Button.hpp index 21e0e99..4538e77 100644 --- a/src/Button.hpp +++ b/src/Button.hpp @@ -26,15 +26,18 @@ * * void loop() { * myButton.read(); - * if (myButton.isPressed()) { /* held down */ } - * if (myButton.wasPressed()) { /* just released */ } + * if (myButton.isPressed()) { } // held down + * if (myButton.wasPressed()) { } // just released * } * @endcode * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/ + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/ColorName.hpp b/src/ColorName.hpp index 89bde52..05d3272 100644 --- a/src/ColorName.hpp +++ b/src/ColorName.hpp @@ -21,9 +21,12 @@ * @endcode * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/ + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/FileUtils.hpp b/src/FileUtils.hpp index 1de02b3..748be8d 100644 --- a/src/FileUtils.hpp +++ b/src/FileUtils.hpp @@ -31,9 +31,12 @@ * @endcode * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/ + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/GraphLine.hpp b/src/GraphLine.hpp index 1f1a79a..5e33b05 100644 --- a/src/GraphLine.hpp +++ b/src/GraphLine.hpp @@ -11,9 +11,15 @@ * headers before this file if not already included. * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * Learn more in the Physical Computing textbook: + * - OLED displays: https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/LineGraph.hpp b/src/LineGraph.hpp index cf1f022..257fad8 100644 --- a/src/LineGraph.hpp +++ b/src/LineGraph.hpp @@ -13,9 +13,15 @@ * @see ScrollingLineGraphMultiValue.hpp (newer version with more features) * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * Learn more in the Physical Computing textbook: + * - OLED displays: https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/MovingAverageFilter.hpp b/src/MovingAverageFilter.hpp index 9cacf8e..cf86eb7 100644 --- a/src/MovingAverageFilter.hpp +++ b/src/MovingAverageFilter.hpp @@ -24,9 +24,12 @@ * @see https://makeabilitylab.github.io/physcomp/advancedio/smoothing-input.html * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/ + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/ParallaxJoystick.hpp b/src/ParallaxJoystick.hpp index 0db5860..1749cd6 100644 --- a/src/ParallaxJoystick.hpp +++ b/src/ParallaxJoystick.hpp @@ -23,9 +23,12 @@ * @endcode * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/ + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/ScrollingLineGraph.hpp b/src/ScrollingLineGraph.hpp index 80003d9..221f21e 100644 --- a/src/ScrollingLineGraph.hpp +++ b/src/ScrollingLineGraph.hpp @@ -28,9 +28,15 @@ * @endcode * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * Learn more in the Physical Computing textbook: + * - OLED displays: https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/ScrollingLineGraphMultiValue.hpp b/src/ScrollingLineGraphMultiValue.hpp index 2f21460..bf7fbe7 100644 --- a/src/ScrollingLineGraphMultiValue.hpp +++ b/src/ScrollingLineGraphMultiValue.hpp @@ -33,9 +33,15 @@ * @endcode * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * Learn more in the Physical Computing textbook: + * - OLED displays: https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include diff --git a/src/Shape.hpp b/src/Shape.hpp index b07ddc8..ead565a 100644 --- a/src/Shape.hpp +++ b/src/Shape.hpp @@ -42,9 +42,15 @@ * @endcode * * @author Jon E. Froehlich - * @jonfroehlich - * https://jonfroehlich.github.io/ - * https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * Learn more in the Physical Computing textbook: + * - OLED displays: https://makeabilitylab.github.io/physcomp/advancedio/oled.html + * + * By Professor Jon E. Froehlich + * Director, Makeability Lab: https://makeabilitylab.cs.washington.edu/ + * Physical Computing Textbook: https://makeabilitylab.github.io/physcomp/ + * + * SPDX-License-Identifier: MIT */ #pragma once #include