Update Docker and workflow configurations for bun.lock handling

This commit is contained in:
Arunavo Ray
2025-05-20 16:03:40 +05:30
parent 4a01a351f0
commit cad72da016
4 changed files with 16 additions and 8 deletions

View File

@@ -5,7 +5,7 @@
# Node.js
node_modules
bun.lock
# We don't exclude bun.lock* as it's needed for the build
npm-debug.log
yarn-debug.log
yarn-error.log

View File

@@ -25,10 +25,17 @@ jobs:
uses: oven-sh/setup-bun@v1
with:
bun-version: '1.2.9'
cache: true
- name: Install dependencies
run: bun install
- name: Check lockfile and install dependencies
run: |
# Check if bun.lock exists, if not check for bun.lockb
if [ -f "bun.lock" ]; then
echo "Using existing bun.lock file"
elif [ -f "bun.lockb" ]; then
echo "Found bun.lockb, creating symlink to bun.lock"
ln -s bun.lockb bun.lock
fi
bun install
- name: Run tests
run: bunx vitest run

View File

@@ -7,14 +7,14 @@ on:
- 'Dockerfile'
- '.dockerignore'
- 'package.json'
- 'bun.lock'
- 'bun.lock*'
pull_request:
branches: [ main ]
paths:
- 'Dockerfile'
- '.dockerignore'
- 'package.json'
- 'bun.lock'
- 'bun.lock*'
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight

View File

@@ -6,7 +6,8 @@ RUN apk add --no-cache libc6-compat python3 make g++ gcc wget sqlite
# ----------------------------
FROM base AS deps
COPY package.json bun.lock ./
COPY package.json ./
COPY bun.lock* ./
RUN bun install --frozen-lockfile
# ----------------------------