firecow / gitlab-ci-local

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

#898: Fix cache path can be undefined. Reuse cache if using pull-policy only #1045

Closed hverlin closed 11 months ago

hverlin commented 11 months ago

Fix #898

image

    create-cache starting alpine:latest (test)
    create-cache copied to docker volumes in 872 ms
    create-cache $ echo "Hello World" > file.txt
    create-cache finished in 1.86 s
    create-cache exported cache file.txt 'my-cache-key-pull-only' in 837 ms
    use-cache starting alpine:latest (test)
    use-cache copied to docker volumes in 791 ms
    use-cache imported cache 'my-cache-key-pull-only' in 53 ms
    use-cache $ cat file.txt
    use-cache > Hello World
    use-cache $ rm file.txt
    use-cache finished in 1.61 s
    use-cache-2 starting alpine:latest (test)
    use-cache-2 copied to docker volumes in 768 ms
    use-cache-2 imported cache 'my-cache-key-pull-only' in 55 ms
    use-cache-2 $ cat file.txt
    use-cache-2 > Hello World
    use-cache-2 finished in 1.56 s
sonarcloud[bot] commented 11 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. Read more here

hverlin commented 11 months ago

@firecow I think this fix is incorrect, actually. Seems that GitLab CI requires the paths to be set:

firecow commented 11 months ago

Great, lets close the issue then 👍