Gitlab Self Hosted Runner .yarn2 cache

26 Views Asked by At

The npm scripts in self hosted runner are not working. The problem seems to be in the yarn2 dependency cache.

Error:

$ yarn eslint
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
image: node:latest

.only: &only
  refs:
    - master
    - merge_requests
    - /^prod-.*/

.defaultJob: &defaultJob
  only:
    <<: *only
  tags:
    - opeq-runner

eslint:
  <<: *defaultJob
  stage: lints
  script:
    - yarn
    - yarn eslint

typecheck:
  <<: *defaultJob
  stage: lints
  script:
    - yarn
    - yarn typecheck

Runner config:

concurrent = 5
check_interval = 0
shutdown_timeout = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "opeq-runner"
  url = "https://gitlab.com"
  id =
  token = ""
  token_obtained_at = 2023-10-09T22:14:01Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "ansible/ansible"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

Tried all the caching options in the yarn config, it seems to be a matter of runner config.

0

There are 0 best solutions below