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:
|
lint-frontend:
|
||||||
stage: lint
|
stage: lint
|
||||||
script:
|
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:
|
needs:
|
||||||
- install-frontend
|
- install-frontend
|
||||||
|
|
||||||
lint-backend:
|
lint-backend:
|
||||||
stage: lint
|
stage: lint
|
||||||
script:
|
script:
|
||||||
|
- npm ci --prefer-offline
|
||||||
- node -c backend/server.js
|
- node -c backend/server.js
|
||||||
- node -c backend/routes/*.js
|
- node -c backend/routes/*.js
|
||||||
- node -c backend/helpers/*.js
|
- node -c backend/helpers/*.js
|
||||||
@@ -99,7 +100,8 @@ lint-backend:
|
|||||||
test-backend:
|
test-backend:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npx jest --ci --forceExit backend/__tests__/
|
- npm ci --prefer-offline
|
||||||
|
- ./node_modules/.bin/jest --ci --forceExit backend/__tests__/
|
||||||
timeout: 5 minutes
|
timeout: 5 minutes
|
||||||
needs:
|
needs:
|
||||||
- install-backend
|
- install-backend
|
||||||
@@ -107,7 +109,7 @@ test-backend:
|
|||||||
test-frontend:
|
test-frontend:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
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
|
timeout: 5 minutes
|
||||||
needs:
|
needs:
|
||||||
- install-frontend
|
- install-frontend
|
||||||
@@ -119,7 +121,7 @@ test-frontend:
|
|||||||
build-frontend:
|
build-frontend:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
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:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- frontend/build/
|
- frontend/build/
|
||||||
|
|||||||
Reference in New Issue
Block a user