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

Shopifolk can use node v20.11.1 for development #11739

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node with v18.12.0
uses: actions/setup-node@v3
- name: Setup Node from .nvmrc
uses: actions/setup-node@v4
with:
node-version: 18.12.0
node-version-file: '.nvmrc'

- name: Check for Changeset
run: npx @changesets/cli status --since="origin/main"
12 changes: 6 additions & 6 deletions .github/workflows/ci-a11y-vrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Setup Node with v18.12.0
uses: actions/setup-node@v3
- name: Setup Node from .nvmrc
uses: actions/setup-node@v4
with:
node-version: 18.12.0
node-version-file: '.nvmrc'
cache: yarn

- name: Restore cache
Expand Down Expand Up @@ -74,10 +74,10 @@ jobs:
with:
fetch-depth: 0 # Chromatic git history to track changes

- name: Setup Node with v18.12.0
uses: actions/setup-node@v3
- name: Setup Node from .nvmrc
uses: actions/setup-node@v4
with:
node-version: 18.12.0
node-version-file: '.nvmrc'
cache: yarn

- name: Restore cache
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decoupling the running of our lint tools (which can be run in any node version) from the running of our tests (which should only be run against the versions of node we support in package.json#engines). See https://github.com/Shopify/polaris-internal/issues/1522 for the differences.


on:
push:
branches:
- main
- next
pull_request:

jobs:
build:
name: 'Lint & type check'
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Free up space on GitHub image
run: |
# Based on the official advice:
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Setup Node from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn

- name: Restore cache
uses: actions/cache@v3
with:
path: |
**/.eslintcache
**/.turbo
node_modules/.cache/turbo
polaris.shopify.com/.next/cache
key: ${{ runner.os }}-lint-v3-${{ github.sha }}
restore-keys: |
${{ runner.os }}-lint-v3-

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Build packages
run: yarn build

- name: Lint
run: yarn lint

- name: Type check
run: yarn type-check
12 changes: 3 additions & 9 deletions .github/workflows/ci.yml → .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
pull_request:

jobs:
build:
name: 'Validate with Node v${{ matrix.node-version }}'
test:
name: 'Test with Node v${{ matrix.node-version }}'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.17.0', '18.12.0']
node-version: ['16.17.0', '18.12.0', '20.11.1']
steps:
- name: Checkout branch
uses: actions/checkout@v3
Expand Down Expand Up @@ -53,11 +53,5 @@ jobs:
- name: Build packages
run: yarn build

- name: Lint
run: yarn lint

- name: Type check
run: yarn type-check

- name: Test
run: yarn test
6 changes: 3 additions & 3 deletions .github/workflows/publish-polaris-for-vscode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- uses: actions/setup-node@v3
name: Use Node.js 16.x
- name: Setup Node from .nvmrc
uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: '.nvmrc'
cache: yarn

- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Setup Node.js
uses: actions/setup-node@v3
- name: Setup Node from .nvmrc
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.0
v20.11.1
2 changes: 1 addition & 1 deletion dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: polaris
up:
- node:
yarn: v1.22.18
version: v18.12.0 # to be kept in sync with .nvmrc and .github/workflows/ci.yml
version: v20.11.1 # to be kept in sync with .nvmrc
- custom:
name: Build monorepo
met?: yarn build --output-logs=none
Expand Down
1 change: 0 additions & 1 deletion polaris-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"dev": "rollup -c -w",
"lint": "run-p lint:*",
"lint:js": "TIMING=1 eslint --cache .",
"lint:styles": "stylelint '**/*.{css,scss}'",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing with the error:

Error: No files matching the pattern "**/*.{css,scss}" were found.

Which makes sense because there's no .css or .scss files in this folder.

But why was it working before?

Because the previous CI task would (unnecessarily) run yarn build which generates dist/**/*.css files. So, when the glob was run, there are files for stylelint to match against, and hence no error. But those files are all in dist/ which is ignored in stylelintrc.js, so stylelint would silently ignore all the files and exit successfully having done nothing.

"test": "jest",
"clean": "rm -rf .turbo node_modules dist *.tsbuildinfo build"
},
Expand Down
Loading