Skip to content

Commit 0044cb8

Browse files
authored
gha(docs-test): setup node v22 (#60722)
* gha(docs-test): setup node v22 * Update doc-tests.yaml to include cache-dependency-path Add cache-dependency-path for yarn.lock in doc tests * Fix yarn install condition * Unconditionally run `yarn install` * Update yarn install command to use frozen-lockfile * Fix go cache Updated Go setup action to version 6.0.0 and added cache dependency path. * Update Node.js setup to use version from package.json Add support for dynamic Node.js version from package.json * Uncomment node-version in doc-tests workflow
1 parent 93db74a commit 0044cb8

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

.github/workflows/doc-tests.yaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,35 +72,29 @@ jobs:
7272
ref: 6f388765b8ce993721502083c74cb9af1fc5658f
7373

7474
- name: Install Go
75-
uses: actions/setup-go@v5
75+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
7676
with:
7777
go-version: 'stable'
78+
cache-dependency-path: shared-workflows/bot/go.sum
7879

7980
- name: Ensure docs changes include redirects
8081
env:
8182
TOKEN: ${{ steps.generate_token.outputs.token }}
8283
REVIEWERS: ${{ secrets.reviewers }}
8384
run: cd shared-workflows/bot && go run main.go -workflow=docpaths -token="${TOKEN}" -teleport-path="${GITHUB_WORKSPACE}/teleport" -reviewers="${REVIEWERS}"
84-
# Cache node_modules. Unlike the example in the actions/cache repo, this
85-
# caches the node_modules directory instead of the yarn cache. This is
86-
# because yarn needs to build fresh packages even when it copies files
87-
# from the yarn cache into node_modules.
88-
# See:
89-
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
90-
- uses: actions/cache@v4
91-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
85+
86+
- name: Install Node.js
87+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
9288
with:
93-
path: '${{ github.workspace }}/docs/node_modules'
94-
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}/docs/yarn.lock', github.workspace)) }}
95-
restore-keys: |
96-
${{ runner.os }}-yarn-
89+
node-version: 22
90+
cache: 'yarn'
91+
cache-dependency-path: '${{ github.workspace }}/docs/yarn.lock'
9792

9893
- name: Install docs site dependencies
9994
working-directory: docs
100-
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
10195
# Prevent occasional `yarn install` executions that run indefinitely
10296
timeout-minutes: 10
103-
run: yarn install
97+
run: yarn install --frozen-lockfile
10498

10599
- name: Prepare docs site configuration
106100
working-directory: docs

0 commit comments

Comments
 (0)