Skip to content

ci(ENG-313): Set up lint workflow and pre-commit configuration#1

Merged
alnoki merged 4 commits into
mainfrom
eng-313
Apr 18, 2026
Merged

ci(ENG-313): Set up lint workflow and pre-commit configuration#1
alnoki merged 4 commits into
mainfrom
eng-313

Conversation

@alnoki

@alnoki alnoki commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Changes

  1. Add GitHub Actions workflows for lint and semantic-pr checks on pull requests.
  2. Add pre-commit configuration with yamllint, markdownlint, mdformat, cspell, checkmake, and standard hygiene hooks, plus their per-tool configs under cfg/.
  3. Add Makefile with lint target (and required all/clean/test phony targets) to run pre-commit locally against the same config used in CI.
  4. Add init-pr and pr-title-description Claude skills for PR workflow automation.

@linear

linear Bot commented Apr 18, 2026

Copy link
Copy Markdown

ENG-313

@alnoki alnoki merged commit 80bea84 into main Apr 18, 2026
2 checks passed
@alnoki alnoki deleted the eng-313 branch April 18, 2026 19:21
alnoki added a commit that referenced this pull request Jun 12, 2026
## Problem

The `Tests` CI job (`.github/workflows/test.yml`) spends ~6.5 min of its
~11 min on essentially every PR's first run installing Solana and
**building anchor-cli from source**, before `make test` starts.

## Root cause

A workflow run can only restore caches created on **its own ref** or on
the repo's **default branch (`main`)** — never on a different PR's ref.
`test.yml` triggered **only** `on: pull_request`, so the job never ran
on a push to `main` and the `main` cache scope — the only scope every PR
can read — was never populated. Every PR's caches lived on
`refs/pull/<N>/merge`, invisible to other PRs, so each new PR missed and
rebuilt the toolchain.

Secondary: the cargo cache key embedded `hashFiles('Cargo.lock')` with
no `restore-keys` fallback, so any `Cargo.lock` change cold-compiled all
deps.

## Fix

1. **Run the job on push to `main`** so a post-merge run saves both the
toolchain cache (`install-toolchain`, key
`toolchain-solana-<ver>-anchor-<rev>-<platform>`) and the cargo cache
into the `main` scope that every subsequent PR inherits — eliminating
the repeated ~6.5 min Anchor builds.
2. **Add `restore-keys` to the cargo cache** so a dep bump restores the
nearest prior cache and compiles incrementally instead of cold.

No new cache step or change to `install-toolchain/action.yml` needed —
its key is already stable/version-pinned; it just needed the `main`
scope populated, which fix #1 provides.

## Verification

After this merges to `main` and a `main` run completes:

1. On a throwaway PR, confirm the `install-toolchain` step logs a
**cache hit** for `toolchain-solana-...` (no `install-tools.sh` run) and
the cargo step hits or restores via `restore-keys`.
2. `gh cache list --json key,ref` shows entries with `ref:
refs/heads/main`.
3. Total Tests wall-clock drops by roughly the ~6.5 min toolchain build.
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.

1 participant