refactor(ci): remove custom Bun setup action and streamline caching steps in CI pipeline

This commit is contained in:
taroj1205 2025-06-22 17:10:00 +12:00
parent fc545b3b88
commit 49f4b1b36f
No known key found for this signature in database
GPG key ID: 0FCB6CFFE0981AB7
2 changed files with 54 additions and 56 deletions

View file

@ -1,46 +0,0 @@
name: "Setup Bun with Cache"
description: "Setup Bun, restore caches, and install dependencies"
inputs:
cache-suffix:
description: 'Suffix for the cache key (e.g., "build", "playwright")'
required: true
enable-astro-cache:
description: "Whether to enable Astro cache restoration"
required: false
default: "false"
bun-version:
description: "Bun version to install"
required: false
default: "latest"
runs:
using: "composite"
steps:
- name: Restore Turborepo Cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ inputs.cache-suffix }}-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-turbo-${{ inputs.cache-suffix }}-
${{ runner.os }}-turbo-
- name: Restore Astro Cache
if: inputs.enable-astro-cache == 'true'
uses: actions/cache@v4
with:
path: |
.astro
node_modules/.astro
key: ${{ runner.os }}-astro-${{ hashFiles('**/bun.lock') }}
restore-keys: ${{ runner.os }}-astro-
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ inputs.bun-version }}
- name: Install dependencies
shell: bash
run: bun install --frozen-lockfile

View file

@ -47,10 +47,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Bun with Cache
uses: ./.github/actions/setup-bun-with-cache
- name: Restore Turborepo Cache
uses: actions/cache@v4
with:
cache-suffix: ${{ matrix.check }}
path: .turbo
key: ${{ runner.os }}-turbo-${{ matrix.check }}-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-turbo-${{ matrix.check }}-
${{ runner.os }}-turbo-
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run ${{ matrix.name }}
run: bunx turbo run ${{ matrix.check }}
@ -63,11 +75,31 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Bun with Cache
uses: ./.github/actions/setup-bun-with-cache
- name: Restore Turborepo Cache
uses: actions/cache@v4
with:
cache-suffix: build
enable-astro-cache: "true"
path: .turbo
key: ${{ runner.os }}-turbo-build-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-turbo-build-
${{ runner.os }}-turbo-
- name: Restore Astro Cache
uses: actions/cache@v4
with:
path: |
.astro
node_modules/.astro
key: ${{ runner.os }}-astro-${{ hashFiles('**/bun.lock') }}
restore-keys: ${{ runner.os }}-astro-
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run Build
run: bunx turbo run build
@ -101,10 +133,22 @@ jobs:
sudo apt-get update
sudo apt-get install -y unzip
- name: Setup Bun with Cache
uses: ./.github/actions/setup-bun-with-cache
- name: Restore Turborepo Cache
uses: actions/cache@v4
with:
cache-suffix: playwright
path: .turbo
key: ${{ runner.os }}-turbo-playwright-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-turbo-playwright-
${{ runner.os }}-turbo-
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run Playwright Tests
run: bunx turbo run test:playwright