🤖 fix: respect HTTP_PROXY env vars for network requests #5486
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: CI | |
| on: | |
| pull_request: | |
| branches: ["**"] | |
| merge_group: | |
| workflow_dispatch: | |
| inputs: | |
| test_filter: | |
| description: 'Optional test filter (e.g., "workspace", "tests/file.test.ts", or "-t pattern")' | |
| required: false | |
| type: string | |
| # This filter is passed to unit tests, integration tests, e2e tests, and storybook tests | |
| # to enable faster iteration when debugging specific test failures in CI | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| static-check: | |
| name: Static Checks (lint + typecheck + fmt) | |
| runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git describe to find tags | |
| - uses: ./.github/actions/setup-mux | |
| - name: Generate version file | |
| run: ./scripts/generate-version.sh | |
| - name: Cache shfmt | |
| id: cache-shfmt | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.local/bin/shfmt | |
| # We install latest via webinstall; reflect that in the cache key to avoid pinning mismatches | |
| key: ${{ runner.os }}-shfmt-latest | |
| restore-keys: | | |
| ${{ runner.os }}-shfmt- | |
| - name: Install and setup shfmt | |
| run: | | |
| # Install shfmt if not cached or if cached binary is broken | |
| if [[ ! -f "$HOME/.local/bin/shfmt" ]] || ! "$HOME/.local/bin/shfmt" --version >/dev/null 2>&1; then | |
| curl -sS https://webinstall.dev/shfmt | bash | |
| fi | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| # Verify shfmt is available | |
| "$HOME/.local/bin/shfmt" --version | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v27 | |
| with: | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Add uv to PATH | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Run static checks | |
| run: make -j3 static-check | |
| test: | |
| name: Unit Tests | |
| runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git describe to find tags | |
| - uses: ./.github/actions/setup-mux | |
| - name: Build worker files | |
| run: make build-main | |
| - name: Run tests with coverage | |
| run: bun test --coverage --coverage-reporter=lcov ${{ github.event.inputs.test_filter || 'src' }} | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| flags: unit-tests | |
| fail_ci_if_error: false | |
| integration-test: | |
| name: Integration Tests | |
| timeout-minutes: 10 | |
| runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git describe to find tags | |
| - uses: ./.github/actions/setup-mux | |
| - name: Build worker files | |
| run: make build-main | |
| - name: Run all integration tests with coverage | |
| # --silent suppresses per-test output (17+ test files × workers = overwhelming logs) | |
| run: TEST_INTEGRATION=1 bun x jest --coverage --maxWorkers=100% --silent ${{ github.event.inputs.test_filter || 'tests' }} | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| flags: integration-tests | |
| fail_ci_if_error: false | |
| storybook-test: | |
| name: Storybook Interaction Tests | |
| runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} | |
| if: github.event.inputs.test_filter == '' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git describe to find tags | |
| - uses: ./.github/actions/setup-mux | |
| - uses: ./.github/actions/setup-playwright | |
| - name: Build Storybook | |
| run: make storybook-build | |
| - name: Serve Storybook | |
| run: | | |
| bun x http-server storybook-static -p 6006 & | |
| sleep 5 | |
| - name: Run Storybook tests | |
| run: make test-storybook | |
| e2e-test: | |
| name: End-to-End Tests | |
| runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} | |
| if: github.event.inputs.test_filter == '' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git describe to find tags | |
| - uses: ./.github/actions/setup-mux | |
| - name: Install xvfb | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xvfb | |
| - uses: ./.github/actions/setup-playwright | |
| - name: Run e2e tests | |
| run: xvfb-run -a make test-e2e | |
| env: | |
| ELECTRON_DISABLE_SANDBOX: 1 | |
| docker-smoke-test: | |
| name: Docker Smoke Test | |
| runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} | |
| # Only run in merge queue (Docker builds are slow) | |
| if: github.event_name == 'merge_group' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git describe to find tags | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| load: true | |
| tags: mux-server:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Start container | |
| run: | | |
| docker run -d --name mux-test -p 3000:3000 mux-server:test | |
| # Wait for server to be ready | |
| for i in {1..30}; do | |
| if curl -sf http://localhost:3000/health; then | |
| echo "Server is ready" | |
| break | |
| fi | |
| echo "Waiting for server... ($i/30)" | |
| sleep 1 | |
| done | |
| - name: Health check | |
| run: | | |
| response=$(curl -sf http://localhost:3000/health) | |
| echo "Health response: $response" | |
| if ! echo "$response" | grep -q '"status":"ok"'; then | |
| echo "Health check failed" | |
| exit 1 | |
| fi | |
| - name: Version check | |
| run: | | |
| response=$(curl -sf http://localhost:3000/version) | |
| echo "Version response: $response" | |
| # Verify response contains expected fields | |
| if ! echo "$response" | grep -q '"mode":"server"'; then | |
| echo "Version check failed: missing mode=server" | |
| exit 1 | |
| fi | |
| if ! echo "$response" | grep -q '"version"'; then | |
| echo "Version check failed: missing version field" | |
| exit 1 | |
| fi | |
| - name: Show container logs on failure | |
| if: failure() | |
| run: docker logs mux-test | |
| - name: Cleanup | |
| if: always() | |
| run: docker rm -f mux-test || true | |
| check-codex-comments: | |
| name: Check Codex Comments | |
| runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git describe to find tags | |
| - name: Check for unresolved Codex comments | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| ./scripts/check_codex_comments.sh ${{ github.event.pull_request.number }} | |
| # Trigger CI run |