From 2328ecca6a8be49892b7d2317669d4a72d48ffe6 Mon Sep 17 00:00:00 2001 From: Jordan Ramos Date: Tue, 26 May 2026 16:22:28 -0600 Subject: [PATCH] fix(ci): replace node_modules artifacts with cache to fix 413 error --- .gitlab-ci.yml | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b53a12e..bcb7892 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,20 +32,22 @@ install-backend: image: node:18 script: - npm ci - artifacts: + cache: + key: backend-${CI_COMMIT_REF_SLUG} paths: - node_modules/ - expire_in: 1 hour + policy: push install-frontend: stage: install image: node:18 script: - cd frontend && npm ci - artifacts: + cache: + key: frontend-${CI_COMMIT_REF_SLUG} paths: - frontend/node_modules/ - expire_in: 1 hour + policy: push # ============================================================================= # STAGE 2: Lint @@ -54,6 +56,11 @@ install-frontend: lint-backend: stage: lint image: node:18 + cache: + key: backend-${CI_COMMIT_REF_SLUG} + paths: + - node_modules/ + policy: pull script: - node -c backend/server.js - node -c backend/routes/*.js @@ -65,6 +72,11 @@ lint-backend: lint-frontend: stage: lint image: node:18 + cache: + key: frontend-${CI_COMMIT_REF_SLUG} + paths: + - frontend/node_modules/ + policy: pull script: - cd frontend && npx eslint src/ --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.js' --max-warnings 25 needs: @@ -79,6 +91,11 @@ test-backend: image: node:18 variables: DATABASE_URL: $DATABASE_URL + cache: + key: backend-${CI_COMMIT_REF_SLUG} + paths: + - node_modules/ + policy: pull script: - ./node_modules/.bin/jest --ci --forceExit backend/__tests__/ timeout: 5 minutes @@ -88,6 +105,11 @@ test-backend: test-frontend: stage: test image: node:18 + cache: + key: frontend-${CI_COMMIT_REF_SLUG} + paths: + - frontend/node_modules/ + policy: pull script: - cd frontend && CI=true npx react-scripts test --watchAll=false --ci timeout: 5 minutes @@ -101,6 +123,11 @@ test-frontend: build-frontend: stage: build image: node:18 + cache: + key: frontend-${CI_COMMIT_REF_SLUG} + paths: + - frontend/node_modules/ + policy: pull script: - cd frontend && CI=false REACT_APP_API_BASE=/api REACT_APP_API_HOST="" npm run build artifacts: