Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump actions versions #1378

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
10 changes: 5 additions & 5 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
@@ -43,7 +43,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Generate files in working directory
shell: bash
run: __tests__/create-cache-files.sh ${{ runner.os }} test-cache
@@ -66,7 +66,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Restore cache
uses: ./
with:
@@ -96,7 +96,7 @@ jobs:
https_proxy: http://squid-proxy:3128
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Generate files
run: __tests__/create-cache-files.sh proxy test-cache
- name: Save cache
@@ -119,7 +119,7 @@ jobs:
https_proxy: http://squid-proxy:3128
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Restore cache
uses: ./
with:
32 changes: 16 additions & 16 deletions caching-strategies.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ This document lists some of the strategies (and example workflows if possible) w
jobs:
build:
runs-on: ubuntu-latest
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
key: ${{ some-metadata }}-cache
```
@@ -24,7 +24,7 @@ In your workflows, you can use different strategies to name your key depending o
One of the most common use case is to use hash for lockfile as key. This way, same cache will be restored for a lockfile until there's a change in dependencies listed in lockfile.

```yaml
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
path/to/dependencies
@@ -37,7 +37,7 @@ One of the most common use case is to use hash for lockfile as key. This way, sa
If cache is not found matching the primary key, restore keys can be used to download the closest matching cache that was recently created. This ensures that the build/install step will need to additionally fetch just a handful of newer dependencies, and hence saving build time.

```yaml
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
path/to/dependencies
@@ -54,7 +54,7 @@ The restore keys can be provided as a complete name, or a prefix, read more [her
In case of workflows with matrix running for multiple Operating Systems, the caches can be stored separately for each of them. This can be used in combination with hashfiles in case multiple caches are being generated per OS.

```yaml
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
path/to/dependencies
@@ -73,7 +73,7 @@ Caches scoped to the particular workflow run id or run attempt can be stored and
On similar lines, commit sha can be used to create a very specialized and short lived cache.

```yaml
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
path/to/dependencies
@@ -86,7 +86,7 @@ On similar lines, commit sha can be used to create a very specialized and short
Cache key can be formed by combination of more than one metadata, evaluated info.

```yaml
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
path/to/dependencies
@@ -146,9 +146,9 @@ In case you are using a centralized job to create and save your cache that can b

```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/cache/restore@v3
- uses: actions/cache/restore@v4
id: cache
with:
path: path/to/dependencies
@@ -171,9 +171,9 @@ You can use the output of this action to exit the workflow on cache miss. This w

```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/cache/restore@v3
- uses: actions/cache/restore@v4
id: cache
with:
path: path/to/dependencies
@@ -194,7 +194,7 @@ steps:
If you want to avoid re-computing the cache key again in `save` action, the outputs from `restore` action can be used as input to the `save` action.

```yaml
- uses: actions/cache/restore@v3
- uses: actions/cache/restore@v4
id: restore-cache
with:
path: |
@@ -219,7 +219,7 @@ On the other hand, the key can also be explicitly re-computed while executing th
Let's say we have a restore step that computes key at runtime

```yaml
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: restore-cache
with:
key: cache-${{ hashFiles('**/lockfiles') }}
@@ -249,7 +249,7 @@ Similarly, `actions/cache/save` action can be conditionally used based on the ou

```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
.
. // restore if need be
.
@@ -270,7 +270,7 @@ In case of multi-module projects, where the built artifact of one project needs

```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build
run: ./build-parent-module.sh
@@ -286,9 +286,9 @@ steps:

```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/cache/restore@v3
- uses: actions/cache/restore@v4
id: cache
with:
path: path/to/dependencies
Loading
Oops, something went wrong.