From a4ecd938f3307d5b14b90280e2fc2826a657ccb6 Mon Sep 17 00:00:00 2001 From: Ali Date: Wed, 4 Nov 2026 18:00:00 +0000 Subject: [PATCH] ci: build the dev container when anything it is built from changes The devcontainer filter listed six paths under .devcontainer/ and not the workflow, so a new file there, or a change to the build job itself, merged without a build. It now matches .devcontainer/** and validate.yaml. The job's runCmd imports the SDK from the environment post-create built instead of echoing, and Validate Status waits on Detect Changes and fails on a cancelled job too. The two actions the change touches are pinned to the commits their tags resolve to. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/validate.yaml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index b800979..39ec576 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -16,17 +16,16 @@ jobs: compose: ${{ steps.filter.outputs.compose }} steps: - uses: actions/checkout@v6 - - uses: dorny/paths-filter@v4 + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: filter with: + # devcontainer: what the dev container is built from (everything + # under .devcontainer/) and this workflow, which holds the job that + # builds it, so a change to that job runs it too. filters: | devcontainer: - - '.devcontainer/devcontainer.json' - - '.devcontainer/compose.yaml' - - '.devcontainer/compose/**' - - '.devcontainer/config/**' - - '.devcontainer/scripts/**' - - '.devcontainer/.env.example' + - '.devcontainer/**' + - '.github/workflows/validate.yaml' scripts: - '.devcontainer/scripts/**' compose: @@ -67,22 +66,28 @@ jobs: steps: - uses: actions/checkout@v6 - name: Build devcontainer - uses: devcontainers/ci@v0.3 + uses: devcontainers/ci@513af61f4de4f75d37e4438f184ba4358f0fc1ca # v0.3.1900000450 with: cacheFrom: ghcr.io/${{ github.repository }}-devcontainer - runCmd: echo "devcontainer smoke test passed" + # Runs after post-create, inside the container: the SDK imports + # from the environment post-create's `uv sync` built. + runCmd: .venv/bin/python -c 'import musher' - # Always-pass job for branch protection required checks + # Always-pass job for branch protection required checks. It waits on + # changes too: when that job fails, every job that needs it is skipped, and + # a scope nobody decided must not read as nothing to check. validate-status: name: Validate Status if: always() - needs: [shellcheck, compose, build] + needs: [changes, shellcheck, compose, build] runs-on: ubuntu-latest steps: - name: Check results + env: + FAILED: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} run: | - if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then - echo "One or more validation jobs failed" + if [[ "$FAILED" == "true" ]]; then + echo "One or more validation jobs failed or were cancelled" exit 1 fi echo "All validation checks passed (or were skipped due to no relevant changes)"