fix(build): update `npm ci` to `npm install`

This commit is contained in:
perf3ct 2025-06-22 22:27:05 +00:00
parent 9b3cdbabfb
commit 182465341a
7 changed files with 18 additions and 20 deletions

View File

@ -16,7 +16,7 @@ env:
jobs: jobs:
e2e-tests: e2e-tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:
postgres: postgres:
image: postgres:16 image: postgres:16
@ -54,8 +54,8 @@ jobs:
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: "20"
cache: 'npm' cache: "npm"
cache-dependency-path: frontend/package-lock.json cache-dependency-path: frontend/package-lock.json
- name: Cache cargo registry - name: Cache cargo registry
@ -69,7 +69,6 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-cargo- ${{ runner.os }}-cargo-
- name: Build backend - name: Build backend
run: cargo build --release run: cargo build --release
env: env:
@ -79,7 +78,7 @@ jobs:
- name: Build frontend - name: Build frontend
working-directory: ./frontend working-directory: ./frontend
run: | run: |
npm ci npm install
npm run build npm run build
- name: Start backend server - name: Start backend server
@ -106,7 +105,6 @@ jobs:
sleep 2 sleep 2
done done
- name: Install Playwright browsers - name: Install Playwright browsers
working-directory: ./frontend working-directory: ./frontend
run: npx playwright install --with-deps run: npx playwright install --with-deps
@ -124,4 +122,4 @@ jobs:
if [ -f backend.pid ]; then if [ -f backend.pid ]; then
kill $(cat backend.pid) || true kill $(cat backend.pid) || true
rm backend.pid rm backend.pid
fi fi

View File

@ -16,7 +16,7 @@ env:
jobs: jobs:
rust-unit-tests: rust-unit-tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -66,11 +66,11 @@ jobs:
frontend-unit-tests: frontend-unit-tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults: defaults:
run: run:
working-directory: ./frontend working-directory: ./frontend
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -78,15 +78,15 @@ jobs:
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: "20"
cache: 'npm' cache: "npm"
cache-dependency-path: frontend/package-lock.json cache-dependency-path: frontend/package-lock.json
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm install
- name: Run type checking - name: Run type checking
run: npm run type-check run: npm run type-check
- name: Run unit tests - name: Run unit tests
run: npm test -- --run run: npm test -- --run

View File

@ -3,7 +3,7 @@ FROM node:20-bookworm as frontend-builder
WORKDIR /frontend WORKDIR /frontend
COPY frontend/package*.json ./ COPY frontend/package*.json ./
RUN npm ci RUN npm install
COPY frontend ./ COPY frontend ./
RUN npm run build RUN npm run build

View File

@ -99,7 +99,7 @@ services:
volumes: volumes:
- ./frontend:/app:ro - ./frontend:/app:ro
- /app/node_modules # Prevent mounting host node_modules - /app/node_modules # Prevent mounting host node_modules
command: ["sh", "-c", "npm ci && npm test -- --run --reporter=verbose"] command: ["sh", "-c", "npm install && npm test -- --run --reporter=verbose"]
networks: networks:
- readur_test_network - readur_test_network
profiles: profiles:
@ -118,7 +118,7 @@ services:
volumes: volumes:
- ./frontend:/app - ./frontend:/app
- /app/node_modules - /app/node_modules
command: ["sh", "-c", "npm ci && npm run dev -- --host 0.0.0.0 --port 5174"] command: ["sh", "-c", "npm install && npm run dev -- --host 0.0.0.0 --port 5174"]
ports: ports:
- "5174:5174" - "5174:5174"
networks: networks:

View File

@ -545,7 +545,7 @@ jobs:
- name: Install Dependencies - name: Install Dependencies
working-directory: frontend working-directory: frontend
run: npm ci run: npm install
- name: Run Frontend Tests - name: Run Frontend Tests
working-directory: frontend working-directory: frontend

View File

@ -302,7 +302,7 @@ run_e2e_tests() {
# Install dependencies if not already installed # Install dependencies if not already installed
if [ ! -d "node_modules" ]; then if [ ! -d "node_modules" ]; then
print_status "Installing frontend dependencies..." print_status "Installing frontend dependencies..."
npm ci npm install
fi fi
# Install Playwright browsers if not already installed # Install Playwright browsers if not already installed

View File

@ -162,7 +162,7 @@ main() {
# Install frontend dependencies # Install frontend dependencies
print_status "Installing frontend dependencies..." print_status "Installing frontend dependencies..."
cd frontend cd frontend
npm ci npm install
# Install Playwright browsers # Install Playwright browsers
print_status "Installing Playwright browsers..." print_status "Installing Playwright browsers..."