3
0
Fork 0
mirror of https://github.com/actions/cache.git synced 2024-12-05 00:39:32 +01:00
Commit graph

60 commits

Author SHA1 Message Date
Joachim Breitner
c64c5261d3
Fix syntax 2021-12-30 11:54:15 +01:00
Joachim Breitner
4e8aa1cc93
Improve Haskell example
as proposed in https://github.com/actions/cache/issues/555
2021-12-29 20:50:37 +01:00
Manuel Roth
67b6d52d50
(R renv) Remove unused renv-cache-path variable (#663) 2021-10-22 11:32:54 -04:00
Manuel Roth
92f67a4829
(R renv) Fix Renv package cache location in examples (#660)
* (R renv) Fix Renv package cache location in examples

* (R env) Update getting Renv package cache location

* (R env) Set renv package cache location using RENV_PATHS_ROOT environment variable
2021-10-22 10:22:58 -04:00
andrewdotn
5807af2642
Fix bugs in example of how to use with pipenv (#607)
* Fix bugs in example of how to use with pipenv

The current example of how to use `@actions/cache` with pipenv has two
problems:

 1. The cached virtualenv that pipenv creates has `bin/python` as a symlink
    into paths like `/opt/hostedtoolcache/Python/3.7.11` that explicitly
    include the patch version of python. When the cache is restored onto a
    machine running a slightly different version of python, e.g., when
    GitHub upgrades its runners from python 3.7.10 to 3.7.11, then any
    attempt to run python in the workflow mysteriously fails with errors
    like `Failed to load paths: /bin/sh: 1: /home/runner/.local/share/virtualenvs/myrepo-sOIMCiTO/bin/python: not found`.

    Therefore the patch version of python should be included in the cache
    key.

 2. `pipenv --install` has the unfortunate behaviour of not cleaning out
    any pre-existing packages. That is, if the `Pipfile` first contains
    dependencies on `foo` and `bar`, and then you remove `bar` from the
    `Pipfile` and run `pipenv install` again, `bar` is still included in
    the virtualenv.

    This can cause false-positive test failures: when a dependency is
    removed from the `Pipfile` but there is still code that relies on the
    removed dependency, tests can still pass if the dependency comes from
    the cache based on a previous revision of `Pipfile.lock`.

    Therefore `restore-keys` should not be set.

This PR attempts to address both of these issues.

* Explain why setup-python is included in example
2021-07-15 14:37:10 -04:00
Peter Mescalchin
0638051e9a
Golang example tweak - add go-build path - rebuild page TOC (#577) 2021-06-01 08:39:29 -05:00
Alex Tokarev
cc2d767a72
Update Rust directories recommended for caching (#433)
This commit applies the suggestion from The Cargo Book:
https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
2021-05-21 12:41:57 -05:00
Daniel Kuschny
2fa955d825
Update examples.md (#588)
Extend gradle notes.
2021-05-13 14:40:34 -05:00
kalin
3a696372f2
elixir typo - stray parenthesis (#569) 2021-04-20 08:51:44 -05:00
Wojtek Mach
366e5ba022
Update cache key for Elixir (#568) 2021-04-19 08:42:01 -05:00
Jonathan Clem
981fa981ed
Merge pull request #469 from ericmj/patch-1
Also cache _build for Elixir
2021-03-31 10:46:31 -04:00
Pradyun Gedam
4498c5b4d8
Drop the example based on using pip's internals (#519)
pip's documentation explicitly states to not use `import pip`:

> While it is implemented in Python, and so is available from your Python code via
> `import pip`, you must not use pip’s internal APIs in this way.

This example is in direct contradiction with the documentation's guidance and, thus, has
been removed.
2021-03-29 17:34:02 -04:00
Benoit Daloze
1bfe3accb3 Recommend ruby/setup-ruby's bundler-cache: true option
Manually caching gems has many issues:
* Not working if there is no Gemfile.lock but only a Gemfile
* Not having the OS version in the key, which might cause binary incompatibility with system libraries of different ABI version.
* Not taking the Ruby version in account.
* Not taking the Ruby ABI version of development builds into accounts, which cannot be done with a key, but needs the commit hash.
* Using restore-keys would grow the cache over time and have extra gems in the cache.
* Those reasons are summarized in https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby#caching-bundle-install-manually
2021-01-28 12:52:25 +01:00
Konrad Pabjan
354332455a
Merge pull request #434 from DanielHabenicht/patch-1
Update examples.md for NPM
2021-01-14 17:22:53 +01:00
Odín del Río
e64ab303d1
Improved gradle cache key calculation example 2021-01-13 22:09:00 +01:00
Chris Patterson
72f66cfa6d
Added a cache example when using matrix 2021-01-12 13:29:18 -05:00
Eric Meadows-Jönsson
62a4d75442
Also cache _build for Elixir 2020-11-24 15:52:21 +01:00
Guillermo Eijo
4557c6a937 Add example for python pipenv 2020-10-22 21:35:30 -03:00
DanielHabenicht
19530ba135
Update examples.md 2020-10-14 02:51:53 +02:00
Shafiq Jetha
8b407f7777
Grammar fix (#405) 2020-09-08 13:10:51 -04:00
Noam Tamim
59a8d125e7
Fix indentation in last pip example 2020-08-05 12:29:52 +03:00
Aiqiao Yan
4978dc4f31
Merge pull request #358 from gaerfield/patch-1
fixes actions/cache#244
2020-07-16 15:48:28 -04:00
Aiqiao Yan
5c77066753
Merge pull request #359 from JLHwung/patch-1
add Yarn 2 cache example
2020-07-16 15:41:08 -04:00
Aiqiao Yan
4aa79d91d3 Rename master to main 2020-07-15 10:36:12 -04:00
Huáng Jùnliàng
5474af707f
add Yarn 2 cache example 2020-07-02 09:43:52 -04:00
gaerfield
591646a21e
fixes actions/cache#244 2020-07-01 10:30:03 +02:00
Marcono1234
eed9cfe64d
Add name for Maven example (#341) 2020-06-18 13:37:50 -04:00
Josh Gross
984ce638f0
Add note about using setup-node before cache (#351) 2020-06-15 15:55:57 -04:00
Aiqiao Yan
e6c708b5ce React to feedback 2020-05-26 15:31:33 -04:00
Aiqiao Yan
581312be20 Update readme and examples to use v2 2020-05-26 12:48:39 -04:00
Shigeki Karita
ddc4681e8d
Add D example. (#303) 2020-05-11 10:24:05 -04:00
Hugo van Kemenade
ccf9619480
Add Python example using 'pip cache dir' to get cache location (#285)
* Fix existing example

* Add Python example using 'pip cache dir' to get cache location

* Let users decide how they install pip 20.1+
2020-04-29 14:58:19 -04:00
Josh Gross
f60097cd16
Fix Lerna Example (#242)
* Fix lerna example

* Fix yaml spacing
2020-04-02 10:35:07 -04:00
Ethan Dennis
eb78578266
Cache multiple paths and add glob pattern support (#212)
* Allow for multiple line-delimited paths to cache

* Add initial minimatch support

* Use @actions/glob for pattern matching

* Cache multiple entries using --files-from tar input

remove known failing test

Quote tar paths

Add salt to test cache

Try reading input files from manifest

bump salt

Run test on macos

more testing

Run caching tests on 3 platforms

Run tests on self-hosted

Apparently cant reference hosted runners by name

Bump salt

wait for some time after save

more timing out

smarter waiting

Cache in tmp dir that won't be deleted

Use child_process instead of actions/exec

Revert tempDir hack

bump salt

more logging

More console logging

Use filepath to with cacheHttpClient

Test cache restoration

Revert temp dir hack

debug logging

clean up cache.yml testing

Bump salt

change debug output

build actions

* unit test coverage for caching multiple dirs

* Ensure there's a locateable test folder at homedir

* Clean up code

* Version cache with all inputs

* Unit test getCacheVersion

* Include keys in getCacheEntry request

* Clean import orders

* Use fs promises in actionUtils tests

* Update import order for to fix linter errors

* Fix remaining linter error

* Remove platform-specific test code

* Add lerna example for caching multiple dirs

* Lerna example updated to v2

Co-Authored-By: Josh Gross <joshmgross@github.com>

Co-authored-by: Josh Gross <joshmgross@github.com>
2020-03-20 16:02:11 -04:00
Dylan Musil
22d71e33ad
Update Node Windows example to find the npm cache (#223) 2020-03-18 22:05:56 -04:00
Jeremy Loy
af8651e0c5
Include Kotlinscript Gradle files (#216)
Tested this with my own repo which uses a mix of `build.gradle` and `build.gradle.kts` files and this glob seems to be working correctly.

As an aside, please checkout #215 as it would make the process of verifying these globs easier!
2020-03-18 09:40:55 -04:00
Sacha Ayoun
826785142a
Adding examples for OCaml/esy (#199)
* Adding examples for esy as a workflow for OCaml files

* track v1 instead of v1.1.2

Co-Authored-By: Josh Gross <joshmgross@github.com>

* add link in the readme for ocaml-esy

* ocaml -> ocaml/reason

* link in readme says ocaml/reason

Co-authored-by: Josh Gross <joshmgross@github.com>
2020-02-26 17:43:11 -05:00
Kipras Melnikovas
e8230b28a9
Use different IDs for 1) getting the directory of yarn cache 2) the cache itself (#178)
* Use different IDs for 1) getting the directory of yarn cache 2) the cache itself

Using the current example + https://github.com/actions/cache#skipping-steps-based-on-cache-hit,

I came to a wrong conclusion that I could skip a step
if the `cache-hit` was `true` -
the ID I used was from the wrong step -
the `get yarn cache directory` step,
instead of the `get yarn cache itself` step.

I've updated the example in hopes that it'll be clearer for others aswell!

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>

* Explain which ID to use for `cache-hit` in yarn's example

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
2020-02-14 09:50:11 -05:00
Florian Kostenzer
e43776276f
Add Swift Package Manager (SPM) example (#159)
* Add Swift - SPM to examples

* Add link SPM example link to readme

* remove extra newline

* remove another extra newline
2020-01-29 11:13:59 -05:00
Shinya Uryu
b6d538e2aa Add renv examples (#151)
* Add renv examples

* Add link in main readme.md
2020-01-21 19:22:40 -05:00
Mike Coutermarsh
6c11532937 Update Ruby docs. "Gem" -> "Bundler" (#150)
* Use "Bundler" which is the package manager

"Gem" isn't wrong, but not typically what a Ruby developer would think of.

* Update links

* Update links
2020-01-12 18:48:43 -05:00
Daniel Shuy
c33bff8d72 Add Scala - SBT example (#134)
* Add Scala - SBT example

* Add Scala - SBT example to README
2020-01-10 17:09:06 -05:00
Flavio Corpa
d1991bb4c5 Add Haskell - Cabal example (#148)
* Add Haskell - Cabal example

* Add link in main readme.md
2020-01-10 17:07:52 -05:00
Nogic
decbafc350
Update examples.md
Co-Authored-By: Chris Patterson <chrispat@github.com>
2019-12-16 09:45:29 +09:00
Nogic
0188dffc5a
Revert original C# Example
* Treat "Use Personal Cache Folder" way as another C# example
* Describe the situation in which another example should be used
2019-12-13 10:03:43 +09:00
Nogic
002d3a77f4
Use Personal Cache Folder in C# Example
Ref: #115
2019-12-10 09:21:47 +09:00
Evan Cloutier
3d01b4eb53 Update Ruby example in documentation to specify bundler path (#113)
* Update Ruby example to specify bundler path

* Fix spacing
2019-11-23 14:13:50 -05:00
Josh Gross
7e7aef2963
Add pip examples (#86) 2019-11-13 10:55:05 -05:00
Josh Gross
50a2fdee6f
Update yarn cache example (#70)
* Update yarn cache example

* Update examples.md

Co-Authored-By: Eric Taylor <erictaylor89@gmail.com>
2019-11-13 10:18:47 -05:00
Josh Gross
bc821d0c12
Remove recommendation to cache node_modules (#69)
* Update npm caching examples

* Fix output name

* Remove extra details tag
2019-11-07 21:04:46 -05:00