Skip to content

Commit

Permalink
[fei5403.1.workflowstonode20] Move workflows to node 20 (#2144)
Browse files Browse the repository at this point in the history
## Summary:
This updates the GitHub workflows to use Node 20 instead of 16.

Issue: FEI-5403

## Test plan:
I verified that with Node 20, I could install node modules and also run a variety of commands:

- `yarn test`
  - Some snapshots needed to be updated due to a change in the error thrown by `JSON.parse`. Instead of `SyntaxError: Unexpected token B in JSON at position 0`, the error looks like `SyntaxError: Unexpected token 'B', "BAD JSON" is not valid JSON`
- `yarn typecheck`
- `yarn lint`

Author: somewhatabstract

Reviewers: jeresig

Required Reviewers:

Approved By: jeresig

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

Pull Request URL: #2144
  • Loading branch information
somewhatabstract authored Dec 19, 2023
1 parent 8c0ab59 commit 636a716
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .changeset/quiet-snakes-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 3 additions & 3 deletions .github/workflows/chromatic-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
# Map the job output to the workflow output.
outputs:
storybookUrl: ${{ steps.chromatic_publish.outputs.storybookUrl }}
Expand All @@ -62,14 +62,14 @@ jobs:
testCount: ${{ steps.chromatic_publish.outputs.testCount }}
steps:
- name: Checking out latest commit
uses: actions/checkout@v2
uses: actions/checkout@v3
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@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chromatic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
# Create/update PR comment with Chromatic results
- name: Find existing comment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
with:
node-version: 16.x
node-version: 20.x

- name: Build all packages
# Build all WB packages that Storybook depends on.
Expand Down
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@v2
- uses: actions/checkout@v3
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
28 changes: 14 additions & 14 deletions .github/workflows/node-ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
with:
Expand All @@ -36,7 +36,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -69,11 +69,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -137,12 +137,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
shard: ["1/2", "2/2"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -154,7 +154,7 @@ jobs:
- name: Run jest tests with coverage
run: yarn coverage:ci --shard ${{ matrix.shard }}
- name: Upload Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
Expand All @@ -166,11 +166,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
# We need to checkout all history, so that the changeset tool can diff it
- name: Checkout current commit
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 @@ -27,9 +27,9 @@ jobs:
# which is very helpful.
matrix:
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
with:
Expand All @@ -47,11 +47,11 @@ jobs:
# Use a matrix as it means we get the version info in the job name
# which is very helpful.
os: [ubuntu-latest]
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -64,7 +64,7 @@ jobs:
- name: Run Jest with coverage
run: yarn coverage:ci
- name: Upload Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v0
with:
node-version: 16.x
node-version: 20.x

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"editor.renderWhitespace": "boundary",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"eslint.enable": true,
"files.trimTrailingWhitespace": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ describe("#getGqlDataFromReponse", () => {

// Assert
await expect(result).rejects.toThrowErrorMatchingInlineSnapshot(`
"Failed to parse response
caused by
SyntaxError: Unexpected token B in JSON at position 0"
`);
"Failed to parse response
caused by
SyntaxError: Unexpected token 'B', "BAD JSON" is not valid JSON"
`);
});

it("should include status code and body text in parse error metadata", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe("RespondWith", () => {

// Assert
await expect(act).rejects.toThrowErrorMatchingInlineSnapshot(
`"invalid json response body at reason: Unexpected token I in JSON at position 0"`,
`"invalid json response body at reason: Unexpected token 'I', "INVALID JSON" is not valid JSON"`,
);
});

Expand Down

0 comments on commit 636a716

Please sign in to comment.