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

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

- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
Copy link
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
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'
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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

- name: Yarn install
run: yarn install --immutable

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
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