Skip to content

Commit

Permalink
[fei5484.1.node20actions] Update to Node 20 action variants (#2204)
Browse files Browse the repository at this point in the history
## Summary:
This updates our actions to variants that use Node 20. There is no variant of `preact/compressed-size-action` for Node 20 (in fact the only released version targets Node 12 and is forced to Node 16 by GitHub - this may be adandoned and we may need to fork it or plan otherwise).

Issue: FEI-5484

## Test plan:
Put this up and see that the workflows run, with a lot less Node 16 deprecation warnings.

Author: somewhatabstract

Reviewers: jeresig

Required Reviewers:

Approved By: jeresig

Checks: ✅ codecov/project, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Lint (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ⏭️  dependabot

Pull Request URL: #2204
  • Loading branch information
somewhatabstract authored Apr 8, 2024
1 parent f745978 commit 6ec9148
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .changeset/cyan-apples-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
12 changes: 6 additions & 6 deletions .github/workflows/chromatic-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ jobs:
testCount: ${{ steps.chromatic_publish.outputs.testCount }}
steps:
- name: Checking out latest commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Chromatic can track
# baselines with the correct commits.
# see: https://www.chromatic.com/docs/branching-and-baselines
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

# Cache and install dependencies
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -89,7 +89,7 @@ jobs:
- name: Publish to Chromatic for visual testing (review PRs only)
id: chromatic_publish
if: ${{ inputs.target == 'review' }}
uses: chromaui/action@v1
uses: chromaui/action@v11
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.projectToken }}
Expand All @@ -102,7 +102,7 @@ jobs:
# (if) Run this step on dependabot or changesets PRs.
- name: Skip Chromatic builds (dependabot or changesets PRs)
if: ${{ inputs.target == 'bot' }}
uses: chromaui/action@v1
uses: chromaui/action@v11
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.projectToken }}
Expand All @@ -115,7 +115,7 @@ jobs:
# (if) Run this step on the main branch.
- name: Auto-accept Chromatic build on main branch.
if: ${{ inputs.target == 'main' }}
uses: chromaui/action@v1
uses: chromaui/action@v11
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.projectToken }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/chromatic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:
steps:
# Create/update PR comment with Chromatic results
- name: Find existing comment
uses: peter-evans/find-comment@b657a70ff16d17651703a84bee1cb9ad9d2be2ea
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: A new build was pushed to Chromatic!

- name: Create or update comment
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-approve-and-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# will not occur.
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.1.1
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Here the PR gets approved.
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
fetch-depth: 0

- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: 20.x

Expand All @@ -32,7 +32,7 @@ jobs:
run: yarn build:storybook

- name: Upload Storybook artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# Upload the generated static files
path: "./storybook-static"
Expand All @@ -52,10 +52,10 @@ jobs:

steps:
- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v5

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

- run: echo ${{ steps.deployment.outputs.page_url }}
2 changes: 1 addition & 1 deletion .github/workflows/gerald-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- uses: Khan/actions@gerald-pr-v0
- uses: Khan/actions@gerald-pr-v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
admin-token: ${{ secrets.KHAN_ACTIONS_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/gerald-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: '${{ github.ref }}'
# GitHub Actions doesn't allow us to take the length of github.event.commits, so we have to pass the array into node and take the length there.
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/node-ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -44,11 +44,11 @@ jobs:
fetch-depth: 0

- name: Get changed files
uses: Khan/actions@get-changed-files-v1
uses: Khan/actions@get-changed-files-v2
id: changed

- name: Filter out files that don't need a changeset
uses: Khan/actions@filter-files-v0
uses: Khan/actions@filter-files-v1
id: match
with:
changed-files: ${{ steps.changed.outputs.files }}
Expand All @@ -71,37 +71,37 @@ jobs:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}

- name: Get All Changed Files
uses: Khan/actions@get-changed-files-v1
uses: Khan/actions@get-changed-files-v2
id: changed

- id: js-ts-files
name: Find .js, .ts changed files
uses: Khan/actions@filter-files-v0
uses: Khan/actions@filter-files-v1
with:
changed-files: ${{ steps.changed.outputs.files }}
extensions: '.js,.jsx,.ts,.tsx'

- id: eslint-reset
uses: Khan/actions@filter-files-v0
uses: Khan/actions@filter-files-v1
name: Files that would trigger a full eslint run
with:
changed-files: ${{ steps.changed.outputs.files }}
files: '.eslintrc.js,yarn.lock,.eslintignore'

- id: typecheck-reset
uses: Khan/actions@filter-files-v0
uses: Khan/actions@filter-files-v1
name: Files that would trigger a typecheck run
with:
changed-files: ${{ steps.changed.outputs.files }}
Expand Down Expand Up @@ -140,21 +140,21 @@ jobs:
node-version: [20.x]
shard: ["1/2", "2/2"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}
# Testing and coverage
- name: Run jest tests with coverage
run: yarn coverage:ci --shard ${{ matrix.shard }}
- name: Upload Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
Expand All @@ -168,14 +168,14 @@ jobs:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
git checkout main
git checkout $REF
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -233,7 +233,7 @@ jobs:
# Note: these two actions are locked to the latest version that were
# published when @jeremy (Jeremy Wiebe) created the original job in Perseus.
- name: Find existing comment
uses: peter-evans/find-comment@034abe94d3191f9c89d870519735beae326f2bdb
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
Expand All @@ -242,7 +242,7 @@ jobs:

- name: Create or update npm snapshot comment - Success
if: steps.publish-snapshot.outputs.npm_snapshot_tag != ''
uses: peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
Expand All @@ -265,7 +265,7 @@ jobs:
```
- name: Create or update npm snapshot comment - Failure
if: steps.publish-snapshot.outputs.npm_snapshot_tag == ''
uses: peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/node-ci-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -49,22 +49,22 @@ jobs:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

# Cache and install dependencies
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}

- name: Run Jest with coverage
run: yarn coverage:ci
- name: Upload Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
fetch-depth: 0

- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
uses: Khan/actions@shared-node-cache-v2
with:
node-version: 20.x

Expand Down

0 comments on commit 6ec9148

Please sign in to comment.