diff --git a/.github/actions/setup-cmux/action.yml b/.github/actions/setup-cmux/action.yml index 7ad43ee65..b7714a618 100644 --- a/.github/actions/setup-cmux/action.yml +++ b/.github/actions/setup-cmux/action.yml @@ -1,13 +1,21 @@ -name: 'Setup cmux build environment' -description: 'Setup Bun and install dependencies' +name: 'Setup Cmux' +description: 'Setup Bun and install dependencies with caching' runs: - using: "composite" + using: 'composite' steps: - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: latest + - name: Cache bun dependencies + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + - name: Install dependencies - run: bun install --frozen-lockfile shell: bash + run: bun install --frozen-lockfile \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 487ac028c..0b411c2e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,21 +13,29 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - run: bun install --frozen-lockfile + - uses: ./.github/actions/setup-cmux - name: Generate version file run: ./scripts/generate-version.sh - - name: Install shfmt + - 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: | - curl -sS https://webinstall.dev/shfmt | bash + if [[ ! -f "$HOME/.local/bin/shfmt" ]]; 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 @@ -45,13 +53,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - run: bun install --frozen-lockfile + - uses: ./.github/actions/setup-cmux - name: Run tests run: make test-unit @@ -63,13 +65,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - run: bun install --frozen-lockfile + - uses: ./.github/actions/setup-cmux - name: Run integration tests run: make test-integration @@ -84,13 +80,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - run: bun install --frozen-lockfile + - uses: ./.github/actions/setup-cmux - name: Install system dependencies run: | diff --git a/Makefile b/Makefile index 9d965c42b..1b9227b57 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ build/icon.icns: docs/img/logo.webp ## Quality checks (can run in parallel) static-check: lint typecheck fmt-check ## Run all static checks -lint: node_modules/.installed ## Run linter and typecheck +lint: node_modules/.installed ## Run ESLint (typecheck runs in separate target) @./scripts/lint.sh lint-fix: node_modules/.installed ## Run linter with --fix diff --git a/scripts/lint.sh b/scripts/lint.sh index 0ca9316b6..7297f91df 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -30,6 +30,5 @@ if [ "$1" = "--fix" ]; then else echo "Running eslint..." bun x eslint "$ESLINT_PATTERN" - ./scripts/typecheck.sh - echo "All lint checks passed!" + echo "ESLint checks passed!" fi