Fix CI: add npm ci to each job since runner cache is unreliable, use local jest binary
This commit is contained in:
@@ -78,13 +78,14 @@ install-frontend:
|
||||
lint-frontend:
|
||||
stage: lint
|
||||
script:
|
||||
- cd frontend && npx eslint src/ --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.js' --max-warnings 10
|
||||
- cd frontend && npm ci --prefer-offline && npx eslint src/ --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.js' --max-warnings 10
|
||||
needs:
|
||||
- install-frontend
|
||||
|
||||
lint-backend:
|
||||
stage: lint
|
||||
script:
|
||||
- npm ci --prefer-offline
|
||||
- node -c backend/server.js
|
||||
- node -c backend/routes/*.js
|
||||
- node -c backend/helpers/*.js
|
||||
@@ -99,7 +100,8 @@ lint-backend:
|
||||
test-backend:
|
||||
stage: test
|
||||
script:
|
||||
- npx jest --ci --forceExit backend/__tests__/
|
||||
- npm ci --prefer-offline
|
||||
- ./node_modules/.bin/jest --ci --forceExit backend/__tests__/
|
||||
timeout: 5 minutes
|
||||
needs:
|
||||
- install-backend
|
||||
@@ -107,7 +109,7 @@ test-backend:
|
||||
test-frontend:
|
||||
stage: test
|
||||
script:
|
||||
- cd frontend && CI=true npx react-scripts test --watchAll=false --ci
|
||||
- cd frontend && npm ci --prefer-offline && CI=true npx react-scripts test --watchAll=false --ci
|
||||
timeout: 5 minutes
|
||||
needs:
|
||||
- install-frontend
|
||||
@@ -119,7 +121,7 @@ test-frontend:
|
||||
build-frontend:
|
||||
stage: build
|
||||
script:
|
||||
- cd frontend && CI=false REACT_APP_API_BASE=/api REACT_APP_API_HOST="" npm run build
|
||||
- cd frontend && npm ci --prefer-offline && CI=false REACT_APP_API_BASE=/api REACT_APP_API_HOST="" npm run build
|
||||
artifacts:
|
||||
paths:
|
||||
- frontend/build/
|
||||
|
||||
Reference in New Issue
Block a user