perf(ci): run affected checks by module #1371
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Build (container package) | |
| run: bun run --cwd packages/container build | |
| - name: Build (terminal package) | |
| run: bun run --cwd packages/terminal build | |
| - name: Build (docker-git package) | |
| run: bun run --cwd packages/app build | |
| - name: Build (session sync package) | |
| run: | | |
| if [ -f packages/docker-git-session-sync/package.json ]; then | |
| bun run --cwd packages/docker-git-session-sync build | |
| else | |
| echo "packages/docker-git-session-sync is not present; skipping" | |
| fi | |
| - name: Build (api) | |
| run: bun run --cwd packages/api build | |
| dist-deps-prune: | |
| name: Dist deps prune | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| with: | |
| node-version: 24.14.0 | |
| - name: Build package | |
| run: bun run --cwd packages/app build | |
| - name: Dist deps prune (lint) | |
| run: bun run check:dist-deps-prune | |
| plan-checks: | |
| name: Plan affected checks | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| outputs: | |
| typecheck_matrix: ${{ steps.plan.outputs.typecheck_matrix }} | |
| typecheck_has_work: ${{ steps.plan.outputs.typecheck_has_work }} | |
| lint_matrix: ${{ steps.plan.outputs.lint_matrix }} | |
| lint_has_work: ${{ steps.plan.outputs.lint_has_work }} | |
| test_matrix: ${{ steps.plan.outputs.test_matrix }} | |
| test_has_work: ${{ steps.plan.outputs.test_has_work }} | |
| lint_effect_matrix: ${{ steps.plan.outputs.lint_effect_matrix }} | |
| lint_effect_has_work: ${{ steps.plan.outputs.lint_effect_has_work }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Compute affected module matrices | |
| id: plan | |
| shell: bash | |
| env: | |
| DOCKER_GIT_CHANGED_BASE: ${{ github.event.pull_request.base.sha }} | |
| DOCKER_GIT_CHANGED_HEAD: ${{ github.sha }} | |
| run: | | |
| set -euo pipefail | |
| write_plan() { | |
| local key="$1" | |
| local operation="$2" | |
| local matrix | |
| matrix="$(node scripts/changed-checks.mjs "$operation" --matrix)" | |
| echo "${key}_matrix=${matrix}" >> "$GITHUB_OUTPUT" | |
| if [[ "$matrix" == '{"include":[]}' ]]; then | |
| echo "${key}_has_work=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "${key}_has_work=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| } | |
| write_plan typecheck typecheck | |
| write_plan lint lint | |
| write_plan test test | |
| write_plan lint_effect lint:effect | |
| types-modules: | |
| name: Types (${{ matrix.label }}) | |
| needs: plan-checks | |
| if: needs.plan-checks.outputs.typecheck_has_work == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.plan-checks.outputs.typecheck_matrix) }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Typecheck module | |
| run: bun run --filter "${{ matrix.packageName }}" "${{ matrix.script }}" | |
| types: | |
| name: Types | |
| needs: [plan-checks, types-modules] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check typecheck module results | |
| env: | |
| MODULE_RESULT: ${{ needs.types-modules.result }} | |
| run: | | |
| if [[ "$MODULE_RESULT" == "failure" || "$MODULE_RESULT" == "cancelled" ]]; then | |
| echo "Typecheck module job result: $MODULE_RESULT" >&2 | |
| exit 1 | |
| fi | |
| echo "Typecheck module job result: $MODULE_RESULT" | |
| lint-modules: | |
| name: Lint (${{ matrix.label }}) | |
| needs: plan-checks | |
| if: needs.plan-checks.outputs.lint_has_work == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.plan-checks.outputs.lint_matrix) }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Lint module | |
| run: bun run --filter "${{ matrix.packageName }}" "${{ matrix.script }}" | |
| lint: | |
| name: Lint | |
| needs: [plan-checks, lint-modules] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check lint module results | |
| env: | |
| MODULE_RESULT: ${{ needs.lint-modules.result }} | |
| run: | | |
| if [[ "$MODULE_RESULT" == "failure" || "$MODULE_RESULT" == "cancelled" ]]; then | |
| echo "Lint module job result: $MODULE_RESULT" >&2 | |
| exit 1 | |
| fi | |
| echo "Lint module job result: $MODULE_RESULT" | |
| test-modules: | |
| name: Test (${{ matrix.label }}) | |
| needs: plan-checks | |
| if: needs.plan-checks.outputs.test_has_work == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.plan-checks.outputs.test_matrix) }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Test module | |
| run: bun run --filter "${{ matrix.packageName }}" "${{ matrix.script }}" | |
| test: | |
| name: Test | |
| needs: [plan-checks, test-modules] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check test module results | |
| env: | |
| MODULE_RESULT: ${{ needs.test-modules.result }} | |
| run: | | |
| if [[ "$MODULE_RESULT" == "failure" || "$MODULE_RESULT" == "cancelled" ]]; then | |
| echo "Test module job result: $MODULE_RESULT" >&2 | |
| exit 1 | |
| fi | |
| echo "Test module job result: $MODULE_RESULT" | |
| lint-effect-modules: | |
| name: Lint Effect-TS (${{ matrix.label }}) | |
| needs: plan-checks | |
| if: needs.plan-checks.outputs.lint_effect_has_work == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.plan-checks.outputs.lint_effect_matrix) }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Lint Effect-TS module | |
| run: bun run --filter "${{ matrix.packageName }}" "${{ matrix.script }}" | |
| lint-effect: | |
| name: Lint Effect-TS | |
| needs: [plan-checks, lint-effect-modules] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check Effect-TS lint module results | |
| env: | |
| MODULE_RESULT: ${{ needs.lint-effect-modules.result }} | |
| run: | | |
| if [[ "$MODULE_RESULT" == "failure" || "$MODULE_RESULT" == "cancelled" ]]; then | |
| echo "Effect-TS lint module job result: $MODULE_RESULT" >&2 | |
| exit 1 | |
| fi | |
| echo "Effect-TS lint module job result: $MODULE_RESULT" | |
| e2e-local-package: | |
| name: E2E (Local package CLI) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Pack and run local package via Bun | |
| run: bash scripts/e2e/local-package-cli.sh | |
| e2e-browser-command: | |
| name: E2E (Browser command) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| env: | |
| DOCKER_GIT_CONTROLLER_BUILD_SKILLER: "0" | |
| DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL: "1" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Free Docker disk | |
| uses: ./.github/actions/free-docker-disk | |
| - name: Docker info | |
| run: docker version && docker compose version | |
| - name: Browser command startup | |
| run: bash scripts/e2e/browser-command.sh | |
| e2e-opencode: | |
| name: E2E (OpenCode) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| env: | |
| DOCKER_GIT_CONTROLLER_BUILD_SKILLER: "0" | |
| DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL: "1" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Free Docker disk | |
| uses: ./.github/actions/free-docker-disk | |
| - name: Docker info | |
| run: docker version && docker compose version | |
| - name: OpenCode autoconnect | |
| run: bash scripts/e2e/opencode-autoconnect.sh | |
| e2e-clone-cache: | |
| name: E2E (Clone cache) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| env: | |
| DOCKER_GIT_CONTROLLER_BUILD_SKILLER: "0" | |
| DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL: "1" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Free Docker disk | |
| uses: ./.github/actions/free-docker-disk | |
| - name: Docker info | |
| run: docker version && docker compose version | |
| - name: Clone cache reuse | |
| run: bash scripts/e2e/clone-cache.sh | |
| e2e-login-context: | |
| name: E2E (Login context) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| env: | |
| DOCKER_GIT_CONTROLLER_BUILD_SKILLER: "0" | |
| DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL: "1" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Free Docker disk | |
| uses: ./.github/actions/free-docker-disk | |
| - name: Docker info | |
| run: docker version && docker compose version | |
| - name: Login context notice | |
| run: bash scripts/e2e/login-context.sh | |
| e2e-runtime-volumes-ssh: | |
| name: E2E (Runtime volumes + SSH) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| env: | |
| DOCKER_GIT_CONTROLLER_BUILD_SKILLER: "0" | |
| DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL: "1" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Free Docker disk | |
| uses: ./.github/actions/free-docker-disk | |
| - name: Docker info | |
| run: docker version && docker compose version | |
| - name: Runtime volumes + host SSH CLI | |
| run: bash scripts/e2e/runtime-volumes-ssh.sh | |
| e2e-clone-auto-open-ssh: | |
| name: E2E (Clone auto-open SSH) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| env: | |
| DOCKER_GIT_CONTROLLER_BUILD_SKILLER: "0" | |
| DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL: "1" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install dependencies | |
| uses: ./.github/actions/setup | |
| - name: Free Docker disk | |
| uses: ./.github/actions/free-docker-disk | |
| - name: Docker info | |
| run: docker version && docker compose version | |
| - name: Clone auto-open SSH | |
| run: bash scripts/e2e/clone-auto-open-ssh.sh |