diff --git a/.github/workflows/pr-lint-typecheck.yml b/.github/workflows/pr-lint-typecheck.yml index 04eb80a..8095725 100644 --- a/.github/workflows/pr-lint-typecheck.yml +++ b/.github/workflows/pr-lint-typecheck.yml @@ -4,17 +4,28 @@ on: push: branches: - main + - develop paths: - ".github/workflows/pr-lint-typecheck.yml" + - "Makefile" + - "platformio.ini" + - "platformio-m5stack.ini" - "pyproject.toml" + - "protobuf/**" - "uv.lock" + - "firmware/lib/generated_protobuf/**" - "stackchan_server/**" - "example_apps/**" pull_request: paths: - ".github/workflows/pr-lint-typecheck.yml" + - "Makefile" + - "platformio.ini" + - "platformio-m5stack.ini" - "pyproject.toml" + - "protobuf/**" - "uv.lock" + - "firmware/lib/generated_protobuf/**" - "stackchan_server/**" - "example_apps/**" @@ -42,3 +53,14 @@ jobs: - name: ty run: uv run ty check stackchan_server example_apps + + - name: Install PlatformIO + run: python -m pip install platformio + + - name: Verify generated protobuf files are up to date + run: | + set -euo pipefail + pio pkg install -e m5stack-cores3-m5unified + make protobuf + git diff --stat -- stackchan_server/generated_protobuf firmware/lib/generated_protobuf + git diff --exit-code -- stackchan_server/generated_protobuf firmware/lib/generated_protobuf diff --git a/.github/workflows/pr-platformio-build.yml b/.github/workflows/pr-platformio-build.yml new file mode 100644 index 0000000..87ec970 --- /dev/null +++ b/.github/workflows/pr-platformio-build.yml @@ -0,0 +1,42 @@ +name: PR PlatformIO Build + +on: + push: + branches: + - main + - develop + paths: + - ".github/workflows/pr-platformio-build.yml" + - "platformio.ini" + - "platformio-m5stack.ini" + - "protobuf/**" + - "firmware/**" + pull_request: + paths: + - ".github/workflows/pr-platformio-build.yml" + - "platformio.ini" + - "platformio-m5stack.ini" + - "protobuf/**" + - "firmware/**" + +jobs: + platformio-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install PlatformIO + run: python -m pip install platformio + + - name: Prepare firmware config + run: cp firmware/include/config.template.h firmware/include/config.h + + - name: Build firmware + run: pio run --environment m5stack-cores3-m5unified diff --git a/firmware/include/config.template.h b/firmware/include/config.template.h index c9db3e8..8921ab7 100644 --- a/firmware/include/config.template.h +++ b/firmware/include/config.template.h @@ -23,8 +23,8 @@ // #define SERVO_SG90_Y_PIN 6 // Center offset added to the logical 90-degree center // Positive values bias X to the right and Y upward; negative values bias X to the left and Y downward -// #define SERVO_SG90_X_CENTER_OFFSET 0 -// #define SERVO_SG90_Y_CENTER_OFFSET 0 +#define SERVO_SG90_X_CENTER_OFFSET 0 +#define SERVO_SG90_Y_CENTER_OFFSET 0 // -- using SCS0009 -- // #define USE_SERVO_SCS0009 1