Skip to content

Commit 0f38fe2

Browse files
ci: Implement new CI and release workflow
1 parent 3452ccc commit 0f38fe2

12 files changed

Lines changed: 213 additions & 259 deletions
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Setup PlatformIO'
2+
description: 'Sets up Python and PlatformIO for build and test jobs'
3+
4+
inputs:
5+
install-matrix-deps:
6+
description: 'Install matrix build dependencies from requirements_matrix_build.txt'
7+
required: false
8+
default: 'false'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.x'
16+
- name: Install PlatformIO
17+
shell: bash
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install wheel platformio
21+
- name: Install matrix build dependencies
22+
if: inputs.install-matrix-deps == 'true'
23+
shell: bash
24+
run: pip install -r requirements_matrix_build.txt
25+
- name: Install unit test dependencies
26+
shell: bash
27+
run: pip install gcovr

.github/workflows/changelog.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
8+
jobs:
9+
pr-title-lint:
10+
name: PR Title (Conventional Commits)
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: read
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
19+
unit-tests:
20+
name: Unit Tests
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: ./.github/actions/setup-pio
25+
with:
26+
install-unit-test-deps: 'true'
27+
- name: Run unit tests
28+
run: pio test -e native -v
29+
- name: Publish Coverage Summary
30+
if: always()
31+
run: |
32+
echo "## Native Unit Test Coverage" >> "$GITHUB_STEP_SUMMARY"
33+
echo >> "$GITHUB_STEP_SUMMARY"
34+
if [ -f .pio/coverage.md ]; then
35+
cat .pio/coverage.md >> "$GITHUB_STEP_SUMMARY"
36+
else
37+
echo "Coverage report was not generated." >> "$GITHUB_STEP_SUMMARY"
38+
fi
39+
40+
build:
41+
name: Build (${{ matrix.board }})
42+
runs-on: ubuntu-latest
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
board:
47+
- mksgenlv21
48+
- mksgenlv2
49+
- mksgenlv1
50+
- esp32
51+
- ramps
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: ./.github/actions/setup-pio
55+
with:
56+
install-matrix-deps: 'true'
57+
- name: Build ${{ matrix.board }}
58+
run: python matrix_build.py -b ${{ matrix.board }}

.github/workflows/code_format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
check:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
with:
1717
ref: ${{ github.event.pull_request.head.ref }}
1818
repository: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/platformio.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/platformio_unit_tests.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
config-file: release-please-config.json
20+
manifest-file: .release-please-manifest.json

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.13.19"
3+
}

RELEASE.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Release Process
2+
3+
This document describes how releases are managed for OpenAstroTracker-Firmware. It is intended for project developers with write access to the repository.
4+
5+
## Overview
6+
7+
Releases are fully automated via [release-please](https://github.com/googleapis/release-please). The process requires no manual version bumping or changelog editing — both are driven by PR titles following the [Conventional Commits](https://www.conventionalcommits.org/) specification.
8+
9+
```
10+
PR merged → release-please updates its Release PR → maintainer merges Release PR → tag + GitHub Release created automatically
11+
```
12+
13+
## Conventional Commits (required for all PRs)
14+
15+
Every PR title **must** follow this format:
16+
17+
```
18+
<type>: <short description>
19+
```
20+
21+
CI will reject PR titles that do not conform.
22+
23+
| Type | Triggers | Example |
24+
|------|----------|---------|
25+
| `feat` | minor version bump | `feat: add AZ/ALT steps-per-degree Meade command` |
26+
| `fix` | patch version bump | `fix: correct sidereal rate after meridian flip` |
27+
| `feat!` or `BREAKING CHANGE:` footer | major version bump | `feat!: remove legacy serial protocol` |
28+
| `chore` | no version bump | `chore: update platformio dependencies` |
29+
| `docs` | no version bump | `docs: clarify wiring diagram for RAMPS` |
30+
| `refactor` | no version bump | `refactor: extract stepper configuration logic` |
31+
| `test` | no version bump | `test: add unit tests for DayTime rollover` |
32+
| `ci` | no version bump | `ci: update clang-format action version` |
33+
| `perf` | no version bump | `perf: reduce interrupt latency in stepper ISR` |
34+
35+
The description becomes the changelog entry, so write it as a user-facing statement of what changed — not what you did internally.
36+
37+
## How release-please Works
38+
39+
After each PR is merged into `develop`, the `release-please` GitHub Action updates an open **Release PR**. This PR:
40+
41+
- Accumulates all `feat`, `fix`, and other notable commits since the last release
42+
- Proposes the next semantic version (patch / minor / major based on commit types)
43+
- Updates `Changelog.md` with categorised entries linked to PRs
44+
- Updates `Version.h` with the new version string
45+
46+
The Release PR stays open and self-updates as more PRs are merged. When you are ready to cut a release, simply **merge the Release PR**.
47+
48+
## Cutting a Release
49+
50+
1. Review the open Release PR (titled `chore(main): release V<version>`) — check the proposed version and changelog entries.
51+
2. Merge it into `develop`.
52+
3. `release-please` automatically:
53+
- Creates a git tag `V<version>` (e.g. `V1.14.0`)
54+
- Publishes a GitHub Release with the generated changelog
55+
56+
No manual tag pushing, no manual `Version.h` edits.
57+
58+
## Version Semantics
59+
60+
Versions follow [Semantic Versioning](https://semver.org/) (`MAJOR.MINOR.PATCH`):
61+
62+
| Change | Bump |
63+
|--------|------|
64+
| Breaking change in Meade protocol or configuration | **Major** |
65+
| New feature, new board support, new Meade command | **Minor** |
66+
| Bug fix, performance improvement, documentation | **Patch** |
67+
| Chore, CI, refactor, test | **None** |
68+
69+
## CI Checks on Every PR
70+
71+
All of the following must pass before a PR can be merged:
72+
73+
| Check | What it validates |
74+
|-------|------------------|
75+
| **PR Title (Conventional Commits)** | PR title follows `<type>: <description>` format |
76+
| **Unit Tests** | `pio test -e native` passes |
77+
| **Build (mksgenlv21)** | Firmware compiles for MKS Gen L V2.1 |
78+
| **Build (mksgenlv2)** | Firmware compiles for MKS Gen L V2 |
79+
| **Build (mksgenlv1)** | Firmware compiles for MKS Gen L V1 |
80+
| **Build (esp32)** | Firmware compiles for ESP32 |
81+
| **Build (ramps)** | Firmware compiles for RAMPS |
82+
| **clang-format** | Code formatting matches `.clang-format`; auto-fixed on same-repo branches |
83+
84+
## Firmware Binaries
85+
86+
Pre-built binaries are **not** published in GitHub Releases. Because the firmware is configured via generated header files (stepper drivers, sensors, display type, etc.), a generic binary would not be usable without recompilation. Users must build the firmware for their specific hardware configuration using PlatformIO.
87+
88+

release-please-config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "simple",
4+
"tag-prefix": "V",
5+
"packages": {
6+
".": {
7+
"release-type": "simple",
8+
"extra-files": [
9+
{
10+
"type": "generic",
11+
"path": "Version.h"
12+
}
13+
]
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)