Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ jobs:
cache: true

- name: Run unit tests
run: go test -v -race -coverprofile=coverage.out $(go list ./... | grep -v /e2e)
run: |
go list ./... | grep -v /e2e \
| xargs go test -v -race -coverprofile=coverage.out

- name: Check coverage
run: |
Expand All @@ -83,20 +85,48 @@ jobs:
with:
version: latest

workflow-drift:
name: Workflow Drift Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.23'
cache: true

- name: Build cascade CLI
run: go build -o /tmp/cascade ./cmd/cascade

- name: Regenerate dogfood workflows
run: /tmp/cascade generate-workflow --config .github/manifest.yaml --force

- name: Verify generated workflows match committed files
run: |
if ! git diff --exit-code -- .github/workflows/ .github/actions/; then
echo "::error::Committed dogfood workflows have drifted from generator output."
echo "Run 'cascade generate-workflow --config .github/manifest.yaml --force' and commit the result."
exit 1
fi
echo "No drift: committed workflows match generator output."

pr-gate:
name: PR Gate
needs: [unit-tests, lint]
needs: [unit-tests, lint, workflow-drift]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Verify gated jobs succeeded or were skipped
run: |
if [ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" = "true" ]; then
echo "A required check failed or was cancelled."
echo " unit-tests: ${{ needs.unit-tests.result }}"
echo " lint: ${{ needs.lint.result }}"
echo " unit-tests: ${{ needs.unit-tests.result }}"
echo " lint: ${{ needs.lint.result }}"
echo " workflow-drift: ${{ needs.workflow-drift.result }}"
exit 1
fi
echo "PR Gate passed (jobs succeeded or were skipped)."
echo " unit-tests: ${{ needs.unit-tests.result }}"
echo " lint: ${{ needs.lint.result }}"
echo " unit-tests: ${{ needs.unit-tests.result }}"
echo " lint: ${{ needs.lint.result }}"
echo " workflow-drift: ${{ needs.workflow-drift.result }}"
6 changes: 5 additions & 1 deletion .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
target_env: ${{ steps.preflight.outputs.target_env }}
source_sha: ${{ steps.preflight.outputs.source_sha }}
source_version: ${{ steps.preflight.outputs.source_version }}
source_image_tag: ${{ steps.preflight.outputs.source_image_tag }}
source_image_digest: ${{ steps.preflight.outputs.source_image_digest }}
changelog_base_sha: ${{ steps.preflight.outputs.changelog_base_sha }}
rollback_sha: ${{ steps.preflight.outputs.rollback_sha }}
rollback_on_failure: ${{ steps.preflight.outputs.rollback_on_failure }}
Expand Down Expand Up @@ -126,9 +128,11 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
version: v0.1.0
- name: Validate Promotion
env:
MODE: ${{ github.event.inputs.mode }}
run: |
echo "Promotion validated by preflight job"
echo "Mode: ${{ github.event.inputs.mode }}"
echo "Mode: $MODE"
echo "Source: ${{ needs.preflight.outputs.source_env }}"
echo "Final Env: ${{ needs.preflight.outputs.target_env }}"
echo "::notice::Promotion validation completed successfully"
Expand Down
Loading