From 0caceb614bf8178b32e4693895254de489387136 Mon Sep 17 00:00:00 2001 From: claude_code Date: Sun, 21 Jun 2026 01:17:27 +0300 Subject: [PATCH] ci: gate develop & release image builds on the test suite The Docker-image builds ran independently of the Test workflow, so a failing test would not block publishing the :develop image (or a release). GitHub Actions `needs:` only works within one workflow, so the two separate workflows didn't depend on each other. Make test.yml a reusable workflow (workflow_call) and call it from develop.yml and release.yml as a `test` job that `build` depends on (`needs: test`); release's `release` job already needs `build`, so it waits transitively. test.yml keeps its pull_request trigger for PR gating; its redundant push:develop trigger is dropped (develop.yml now calls it on push). Co-Authored-By: Claude Opus 4.8 --- .github/workflows/develop.yml | 5 +++++ .github/workflows/release.yml | 5 +++++ .github/workflows/test.yml | 4 +--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 5959983e..2d81467c 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -18,7 +18,12 @@ env: IMAGE: ghcr.io/vvzvlad/gitmost jobs: + # Run the reusable test suite first so a failing test blocks the image build. + test: + uses: ./.github/workflows/test.yml + build: + needs: test runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7137d953..694df01b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,12 @@ env: IMAGE: ghcr.io/vvzvlad/gitmost jobs: + # Run the reusable test suite first so a failing test blocks the image build. + test: + uses: ./.github/workflows/test.yml + build: + needs: test strategy: matrix: include: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54a82264..955b0ac2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,7 @@ name: Test on: pull_request: - push: - branches: - - develop + workflow_call: workflow_dispatch: concurrency: -- 2.49.1