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

inputs:
restore-cache:
description: "Whether to restore node_modules cache"
required: false
default: "true"

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

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

- name: Restore node_modules
if: inputs.restore-cache == 'true'
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('yarn.lock') }}
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
push:
branches:
- main
pull_request:

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

- name: Setup node
uses: ./.github/actions/setup-node
with:
restore-cache: false

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

- name: Cache node_modules
uses: actions/cache/save@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('yarn.lock') }}

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

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

- name: Check formatting
run: yarn format

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

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

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

- name: Run build
run: yarn build
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