Skip to content

ci: cache CI environments & add PR template#269

Merged
kellervater merged 3 commits intomainfrom
ci/cache-precommit-environments
Mar 15, 2026
Merged

ci: cache CI environments & add PR template#269
kellervater merged 3 commits intomainfrom
ci/cache-precommit-environments

Conversation

@kellervater
Copy link
Member

@kellervater kellervater commented Mar 15, 2026

📦 What

  • ⚡ Add caching for pip, apt packages, OpenSCAD + libraries, and pre-commit hook environments in CI workflows
  • 🔧 Extract shared setup steps into a reusable composite action (.github/actions/setup-openscad/)
  • 📝 Add PR template (.github/pull_request_template.md) with What/Why/How sections
  • 🤖 Add emoji guideline to copilot-instructions.md

💡 Why

The pre-commit and validate-models workflows were slow (~3 min) because every run reinstalled all environments from scratch. By caching at four layers, warm runs complete in ~52s (~3.5x faster):

Layer Tool Cache key
pip packages setup-python built-in cache: 'pip' pyproject.toml hash
apt packages awalsh128/cache-apt-pkgs-action@v1.6.0 package list
OpenSCAD + BOSL2 actions/cache@v5 on bin/openscad/ scadm.json + constants.py hash
pre-commit hooks pre-commit/action built-in .pre-commit-config.yaml hash

The composite action eliminates duplication — setup logic lives in one place instead of being copied across workflows. scadm install is idempotent (checks version before downloading), so it safely no-ops on cache hits.

PR template standardizes descriptions across the project.

🔧 How

No changes needed for consumers. Both workflows use the composite action automatically:

- uses: ./.github/actions/setup-openscad

New PRs will show the What/Why/How template by default.

Add caching to pre-commit and validate-models workflows:
- Cache pip downloads via setup-python's built-in cache
- Cache bin/openscad/ (OpenSCAD + BOSL2) via actions/cache
  keyed on scadm.json and constants.py (version pins)

scadm install is idempotent (skips if version matches),
so it safely no-ops on cache hits.
Copilot AI review requested due to automatic review settings March 15, 2026 11:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CI caching to speed up OpenSCAD model validation and pre-commit runs by reusing Python package downloads and the scadm-managed OpenSCAD installation across workflow executions.

Changes:

  • Enable actions/setup-python pip caching keyed off cmd/scadm/pyproject.toml.
  • Cache bin/openscad/ (OpenSCAD + libraries) keyed off scadm.json and cmd/scadm/scadm/constants.py.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/validate-models.yml Adds pip cache + OpenSCAD/libraries cache before running scadm install and model renders.
.github/workflows/pre-commit.yml Adds pip cache + OpenSCAD/libraries cache before running scadm install and pre-commit hooks.

Move shared setup steps (Python, apt packages, OpenSCAD cache, scadm)
into .github/actions/setup-openscad/action.yml.

- Cache apt packages via awalsh128/cache-apt-pkgs-action@v1.6.0
- Cache pip via setup-python built-in cache
- Cache bin/openscad/ via actions/cache@v5
- Both pre-commit and validate-models workflows now reference
  the composite action, eliminating duplication
- Add .github/pull_request_template.md with What/Why/How sections
- Add emoji usage guideline to copilot-instructions.md
Copilot AI review requested due to automatic review settings March 15, 2026 11:44
@kellervater kellervater changed the title ci: cache pip and OpenSCAD in CI workflows ci: cache CI environments & add PR template Mar 15, 2026
@kellervater kellervater merged commit ca78385 into main Mar 15, 2026
8 checks passed
@kellervater kellervater deleted the ci/cache-precommit-environments branch March 15, 2026 11:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a reusable composite GitHub Action to set up OpenSCAD (plus dependencies) with caching, then updates CI workflows to use it in order to speed up runs. It also adds a PR template and tweaks Copilot guidance.

Changes:

  • Replace inline OpenSCAD + dependency installation in CI workflows with a local composite action.
  • Add caching for pip dependencies and bin/openscad (OpenSCAD + bundled libraries).
  • Add a PR template and update .github/copilot-instructions.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/validate-models.yml Uses the new setup-openscad composite action instead of inline install steps.
.github/workflows/pre-commit.yml Uses the new setup-openscad composite action before running pre-commit.
.github/actions/setup-openscad/action.yml New composite action implementing Python setup, apt deps, and caching.
.github/pull_request_template.md Adds a PR description template.
.github/copilot-instructions.md Updates Copilot contribution guidance.

Comment on lines +23 to +24
- name: Setup OpenSCAD
uses: ./.github/actions/setup-openscad
Comment on lines +16 to +18
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
with:
packages: xvfb libglu1-mesa libfuse2 libegl1 libxcb-cursor0
Comment on lines +1 to +11
## 📦 What

<!-- What changed, was added, or was removed? -->

## 💡 Why

<!-- What's the use case? Why this approach over alternatives? -->

## 🔧 How

<!-- How to use the changes. Include examples if calling conventions, parameters, or processes changed. Link to relevant docs if applicable. -->
kellervater pushed a commit that referenced this pull request Mar 15, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>homeracker: 1.8.0</summary>

##
[1.8.0](homeracker-v1.7.8...homeracker-v1.8.0)
(2026-03-15)


### ✨ Features

* **ci:** switch BOSL2 to release tags & add SessionStart hook
([#265](#265))
([020cf14](020cf14))
* **core:** extended lockpin with neck extensions and grip types
([#259](#259))
([4720f98](4720f98))


### 🐛 Bug Fixes

* **renovate:** disable prHourlyLimit
([#266](#266))
([3b0894c](3b0894c))


### 📦 Dependencies

* update actions/create-github-app-token action to v3
([#268](#268))
([75d0098](75d0098))
* update belfryscad/bosl2 digest to bfc4e74
([#260](#260))
([a571590](a571590))
* update camunda/infra-global-github-actions digest to f5807d2
([#261](#261))
([612947b](612947b))
* update dependency belfryscad/bosl2 to v2.0.727
([#267](#267))
([8f85820](8f85820))
* update openscad nightly to v2026.03.14
([#263](#263))
([7a0aead](7a0aead))
* update pre-commit hooks
([#264](#264))
([c55691d](c55691d))


### 🔄 CI/CD

* cache CI environments & add PR template
([#269](#269))
([ca78385](ca78385))
</details>

<details><summary>scadm: 0.4.11</summary>

##
[0.4.11](scadm-v0.4.10...scadm-v0.4.11)
(2026-03-15)


### 📦 Dependencies

* update openscad nightly to v2026.03.14
([#263](#263))
([7a0aead](7a0aead))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: kellerlab-release-please[bot] <246533846+kellerlab-release-please[bot]@users.noreply.github.com>
kellervater pushed a commit that referenced this pull request Mar 15, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>homeracker: 1.9.0</summary>

##
[1.9.0](homeracker-v1.8.0...homeracker-v1.9.0)
(2026-03-15)


### ✨ Features

* **setup-openscad:** make action reusable across repositories
([#273](#273))
([055e784](055e784))


### 📦 Dependencies

* update pre-commit hook renovatebot/pre-commit-hooks to v43.76.1
([#270](#270))
([5391857](5391857))
</details>

<details><summary>setup-openscad: 1.0.0</summary>

## 1.0.0 (2026-03-15)


### ✨ Features

* **setup-openscad:** make action reusable across repositories
([#273](#273))
([055e784](055e784))


### 🔄 CI/CD

* cache CI environments & add PR template
([#269](#269))
([ca78385](ca78385))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: kellerlab-release-please[bot] <246533846+kellerlab-release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants