diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e88d66c..73f0545 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,10 +10,11 @@ # 5. deploy — restart services on the local machine (manual trigger) # # Executor: shell (runs directly on dashboard-dev using system Node.js) +# Uses cache (not artifacts) for node_modules to avoid upload size limits. # ============================================================================= # --------------------------------------------------------------------------- -# Global cache — speeds up repeated runs by reusing node_modules +# Global cache — persists node_modules between pipeline runs on this runner # --------------------------------------------------------------------------- cache: key: ${CI_COMMIT_REF_SLUG} @@ -39,20 +40,12 @@ install-backend: stage: install script: - npm install - artifacts: - paths: - - node_modules/ - expire_in: 1 hour install-frontend: stage: install script: - cd frontend - npm install - artifacts: - paths: - - frontend/node_modules/ - expire_in: 1 hour # ============================================================================= # STAGE 2: Lint / static analysis @@ -60,9 +53,9 @@ install-frontend: lint-frontend: stage: lint - needs: ["install-frontend"] script: - cd frontend + - npm install - npx eslint src/ --max-warnings 0 allow_failure: true # non-blocking until the team cleans up existing warnings @@ -72,16 +65,16 @@ lint-frontend: test-backend: stage: test - needs: ["install-backend"] script: + - npm install - npx jest --ci --forceExit --detectOpenHandles backend/__tests__/ timeout: 5 minutes test-frontend: stage: test - needs: ["install-frontend"] script: - cd frontend + - npm install - CI=true npx react-scripts test --watchAll=false --ci --forceExit timeout: 5 minutes @@ -91,9 +84,9 @@ test-frontend: build-frontend: stage: build - needs: ["install-frontend", "test-frontend"] script: - cd frontend + - npm install - REACT_APP_API_BASE=/api REACT_APP_API_HOST="" npm run build artifacts: paths: @@ -111,7 +104,6 @@ build-frontend: deploy: stage: deploy - needs: ["build-frontend"] rules: - if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master" when: manual