From b0dbec6de7ea8c16343b325e5ff5a56abdc5becc Mon Sep 17 00:00:00 2001 From: Samuel K Date: Thu, 23 Apr 2026 12:59:09 -0500 Subject: [PATCH 1/4] ci: gate build and test jobs on pre-commit and lint checks Add pre-commit and lint as jobs inside pr-ci.yml and make build-cli and build-ui depend on them via `needs`. This prevents wasting CI runner time on builds and tests when basic quality checks fail. --- .github/workflows/pr-ci.yml | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 8f9e312ce..678a88e7f 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -7,6 +7,58 @@ on: pull_request: jobs: + precommit: + name: Pre-commit Gate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: biomejs/setup-biome@v2 + + - uses: actions/setup-python@v6 + with: + cache: pip + python-version: 3.x + + - run: pip install -r requirements.txt + + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - uses: golangci/golangci-lint-action@v9 + with: + version: latest + install-only: true + + - run: go install golang.org/x/tools/cmd/goimports@latest + + - uses: actions/cache@v5 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + + - run: pre-commit run --all-files + + lint-gate: + name: Lint Gate + runs-on: ubuntu-latest + steps: + - uses: jlumbroso/free-disk-space@v1.3.1 + + - uses: actions/checkout@v6 + + - name: setup Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: latest + only-new-issues: true + can-read-secret: name: Can Read Secret runs-on: ubuntu-latest @@ -24,6 +76,7 @@ jobs: build-ui: name: User Interface Build + needs: [precommit, lint-gate] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -55,6 +108,7 @@ jobs: build-cli: name: Build CLI Binary on ${{ matrix.runner }} + needs: [precommit, lint-gate] strategy: matrix: include: From e9e821bbcb35efcb862afba0fa247cabea29587d Mon Sep 17 00:00:00 2001 From: Samuel K Date: Thu, 23 Apr 2026 13:44:38 -0500 Subject: [PATCH 2/4] ci: remove unnecessary free-disk-space step from lint workflow golangci-lint doesn't need extra disk space and this step adds significant time to the job. --- .github/workflows/lint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 81831943d..f09e8c896 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,8 +11,6 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: jlumbroso/free-disk-space@v1.3.1 - - uses: actions/checkout@v6 - name: setup Go From 10014099e84c397a7f9e089ac2ac2e2af934cde6 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Thu, 23 Apr 2026 13:47:12 -0500 Subject: [PATCH 3/4] ci: also remove free-disk-space from lint-gate in pr-ci.yml --- .github/workflows/pr-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 678a88e7f..7c5122603 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -44,8 +44,6 @@ jobs: name: Lint Gate runs-on: ubuntu-latest steps: - - uses: jlumbroso/free-disk-space@v1.3.1 - - uses: actions/checkout@v6 - name: setup Go From fd22025ab99ced63510086b1c860f4aa230e858c Mon Sep 17 00:00:00 2001 From: Samuel K Date: Thu, 23 Apr 2026 14:23:59 -0500 Subject: [PATCH 4/4] ci: replace pre-commit with prek-action for faster CI Swap the manual pre-commit setup (biome, python, go, golangci-lint, goimports, cache) with j178/prek-action@v2 which handles all of this automatically and more efficiently. --- .github/workflows/pr-ci.yml | 27 +-------------------------- .github/workflows/pre-commit.yml | 27 +-------------------------- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 7c5122603..683539002 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -13,32 +13,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: biomejs/setup-biome@v2 - - - uses: actions/setup-python@v6 - with: - cache: pip - python-version: 3.x - - - run: pip install -r requirements.txt - - - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - - - uses: golangci/golangci-lint-action@v9 - with: - version: latest - install-only: true - - - run: go install golang.org/x/tools/cmd/goimports@latest - - - uses: actions/cache@v5 - with: - path: ~/.cache/pre-commit - key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} - - - run: pre-commit run --all-files + - uses: j178/prek-action@v2 lint-gate: name: Lint Gate diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a72c37d44..1643e9522 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,29 +15,4 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: biomejs/setup-biome@v2 - - - uses: actions/setup-python@v6 - with: - cache: pip - python-version: 3.x - - - run: pip install -r requirements.txt - - - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - - - uses: golangci/golangci-lint-action@v9 - with: - version: latest - install-only: true - - - run: go install golang.org/x/tools/cmd/goimports@latest - - - uses: actions/cache@v5 - with: - path: ~/.cache/pre-commit - key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} - - - run: pre-commit run --all-files + - uses: j178/prek-action@v2