mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-14 10:24:30 +00:00
fix(ci): isolate bun cache per job
This commit is contained in:
@@ -17,13 +17,17 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
validate:
|
validate:
|
||||||
runs-on: [self-hosted, linux, x64]
|
runs-on: [self-hosted, linux, x64]
|
||||||
|
env:
|
||||||
|
# Keep Bun cache isolated per job workspace so parallel self-hosted runs
|
||||||
|
# do not race on ~/.bun/install/cache and corrupt restore/install state.
|
||||||
|
BUN_INSTALL_CACHE_DIR: ${{ github.workspace }}/.bun/install/cache
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
check:
|
check:
|
||||||
- { name: typecheck, cmd: 'bun run typecheck' }
|
- { name: typecheck, cmd: 'bun run typecheck' }
|
||||||
- { name: lint, cmd: 'bun run lint' }
|
- { name: lint, cmd: 'bun run lint' }
|
||||||
- { name: format, cmd: 'bun run format:check' }
|
- { name: format, cmd: 'bun run format:check' }
|
||||||
name: ${{ matrix.check.name }}
|
name: ${{ matrix.check.name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -44,7 +48,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.bun/install/cache
|
${{ env.BUN_INSTALL_CACHE_DIR }}
|
||||||
key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }}
|
key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-bun-cache-v2-
|
${{ runner.os }}-bun-cache-v2-
|
||||||
@@ -58,6 +62,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: [self-hosted, linux, x64]
|
runs-on: [self-hosted, linux, x64]
|
||||||
name: build
|
name: build
|
||||||
|
env:
|
||||||
|
BUN_INSTALL_CACHE_DIR: ${{ github.workspace }}/.bun/install/cache
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -76,7 +82,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.bun/install/cache
|
${{ env.BUN_INSTALL_CACHE_DIR }}
|
||||||
key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }}
|
key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-bun-cache-v2-
|
${{ runner.os }}-bun-cache-v2-
|
||||||
@@ -99,6 +105,8 @@ jobs:
|
|||||||
runs-on: [self-hosted, linux, x64]
|
runs-on: [self-hosted, linux, x64]
|
||||||
name: test
|
name: test
|
||||||
needs: [build]
|
needs: [build]
|
||||||
|
env:
|
||||||
|
BUN_INSTALL_CACHE_DIR: ${{ github.workspace }}/.bun/install/cache
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -117,7 +125,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.bun/install/cache
|
${{ env.BUN_INSTALL_CACHE_DIR }}
|
||||||
key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }}
|
key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-bun-cache-v2-
|
${{ runner.os }}-bun-cache-v2-
|
||||||
|
|||||||
Reference in New Issue
Block a user