Skip to content

Commit

Permalink
Merge pull request #651 from magnetikonline/fix-golang-windows-example
Browse files Browse the repository at this point in the history
Fix Golang windows example - updated `README.md` test badge markdown.
  • Loading branch information
Vipul authored and GitHub committed Mar 9, 2022
2 parents c7c46bc + 6535c5f commit deae296
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

This action allows caching dependencies and build outputs to improve workflow execution time.

<a href="https://github.com/actions/cache/actions?query=workflow%3ATests"><img alt="GitHub Actions status" src="https://github.com/actions/cache/workflows/Tests/badge.svg?branch=main&event=push"></a>
[![Tests](https://github.com/actions/cache/actions/workflows/workflow.yml/badge.svg)](https://github.com/actions/cache/actions/workflows/workflow.yml)

## Documentation

See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).

## What's New

* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches.
* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches.

```yaml
- name: Cache multiple paths
Expand Down Expand Up @@ -38,7 +38,7 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in

### Inputs

* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
* `key` - An explicit key for restoring and saving the cache
* `restore-keys` - An ordered list of keys to use for restoring the cache if no cache hit occurred for key

Expand All @@ -49,7 +49,7 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in
> See [Skipping steps based on cache-hit](#Skipping-steps-based-on-cache-hit) for info on using this output

### Cache scopes
The cache is scoped to the key and branch. The default branch cache is available to other branches.
The cache is scoped to the key and branch. The default branch cache is available to other branches.

See [Matching a cache key](https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key) for more info.

Expand Down Expand Up @@ -88,7 +88,7 @@ Every programming language and framework has its own way of caching.

See [Examples](examples.md) for a list of `actions/cache` implementations for use with:

- [C# - Nuget](./examples.md#c---nuget)
- [C# - NuGet](./examples.md#c---nuget)
- [D - DUB](./examples.md#d---dub)
- [Deno](./examples.md#deno)
- [Elixir - Mix](./examples.md#elixir---mix)
Expand Down Expand Up @@ -121,9 +121,9 @@ For example, using the [`hashFiles`](https://help.github.com/en/actions/referenc
```yaml
- uses: actions/cache@v2
with:
path: |
path: |
path/to/dependencies
some/other/dependencies
some/other/dependencies
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
```

Expand Down
7 changes: 3 additions & 4 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
- [Using pip to get cache location](#using-pip-to-get-cache-location)
- [Python - pipenv](#python---pipenv)
- [R - renv](#r---renv)
- [Simple example](#simple-example-1)
- [Multiple OS's in a workflow](#multiple-oss-in-a-workflow-1)
- [Ruby - Bundler](#ruby---bundler)
- [Rust - Cargo](#rust---cargo)
- [Scala - SBT](#scala---sbt)
Expand Down Expand Up @@ -71,6 +69,7 @@ With `actions/cache@v2` you can now exclude unwanted packages with [exclude patt

Or you could move the cache folder like below.
>Note: This workflow does not work for projects that require files to be placed in user profile package folder

```yaml
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
Expand Down Expand Up @@ -190,8 +189,8 @@ steps:
- uses: actions/cache@v2
with:
path: |
%LocalAppData%\go-build
~/go/pkg/mod
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand Down

0 comments on commit deae296

Please sign in to comment.