mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 17:05:32 +02:00
refactor(ci): remove custom Bun setup action and streamline caching steps in CI pipeline
This commit is contained in:
parent
fc545b3b88
commit
49f4b1b36f
2 changed files with 54 additions and 56 deletions
46
.github/actions/setup-bun-with-cache/action.yml
vendored
46
.github/actions/setup-bun-with-cache/action.yml
vendored
|
@ -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
|
64
.github/workflows/ci-pipeline.yml
vendored
64
.github/workflows/ci-pipeline.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue