firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.35k stars 134 forks source link

Cache is mixed up between node_modules and vendor directories #1390

Closed lk77 closed 1 week ago

lk77 commented 2 weeks ago

The cache does not seems to work with gcl, a simple config as below fail with gcl but succeed with gitlab,

if i do ls vendor i get the files that should be in node_modules

any artisan command fails because there is no autoload.php file in vendor directory (overrided by npm install)

---
myjob:
  allow_failure: false
  image: 'myimage'
  when: manual
  script:
    - composer install
    - npm install
    - php artisan
  cache:
    key:
      files:
        - package-lock.json
        - composer.lock
    paths:
      - node_modules/
      - vendor/

Expected behavior The cache is not mixed up between node_modules and vendor

Host information Ubuntu 22 gitlab-ci-local 4.55.0

Containerd binary docker runner is used, but gcl runs in wsl

thanks.

edit :

MOUNT_CACHE=true seems to be the issue here in .gitlab-ci-local-env

firecow commented 2 weeks ago

@lk77 I think this is a caveat of MOUNT_CACHE, and it doesn't work in all instances.

lk77 commented 1 week ago

@firecow okey thanks, then i will not use it, thanks.