Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 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
24 changes: 24 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup Node
description: Setup Node with yarn and restore cached dependencies

inputs:
immutable-install:
description: Whether to run `yarn install --immutable`
required: false
default: 'false'

runs:
using: composite
steps:
- name: Enable corepack
shell: bash
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe node_modules caching is built into this action. Can we leverage that instead of trying to handle the caching ourselves?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh good find. I'll push & play around with it

with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
run: yarn install ${{ inputs.immutable-install == 'true' && '--immutable' || '' }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yarn install is immutable by default in CI. I don't mind adding the explicit flag, but I don't think there's any case where we don't want the install to be immutable in CI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's surprising. Does yarn throw a status code of 1 when yarn install updates the lock file?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes

62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
install:
name: Install dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup node
uses: ./.github/actions/setup-node
with:
immutable-install: true

format:
name: Format
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup node
uses: ./.github/actions/setup-node

- name: Run format
run: yarn format --check

lint:
name: Lint
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup node
uses: ./.github/actions/setup-node

- name: Run lint
run: yarn lint

build:
name: Build
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup node
uses: ./.github/actions/setup-node

- name: Run build
run: yarn build
2 changes: 1 addition & 1 deletion .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# A Docker image with Semgrep installed. Do not change this.
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN_PUBLIC }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.17.0
v24.14.1
5 changes: 4 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"plugins": ["eslint", "import", "oxc", "react", "typescript"]
"plugins": ["eslint", "import", "oxc", "react", "typescript"],
"categories": {
"correctness": "error"
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,11 @@ __metadata:
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I missed this change in a previous PR. CI correctly caught it.

react:
optional: true
react-dom:
optional: true
languageName: unknown
linkType: soft

Expand Down
Loading