build(deps): update node.js to v22 #2625
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
run-benchmarks: | |
name: Run benchmarks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Git repository | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
# Required due to a limitation in setup-node https://github.com/actions/setup-node/issues/480#issuecomment-1820622085 | |
run: corepack enable | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Install dependencies with Yarn | |
run: yarn install --immutable | |
- name: Build package | |
run: yarn run build | |
- name: Run benchmarks | |
run: yarn start | |
env: | |
NODE_ENV: production | |
- name: Update benchmark results in readme | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
git config --global user.email "js.unit.conversion.benchmarks@jonah.pw" | |
git config --global user.name "js-unit-conversion-benchmarks" | |
git remote add github "https://$GITHUB_ACTOR@github.com/$GITHUB_REPOSITORY.git" | |
git fetch github | |
git add readme.md | |
# Exit succesfully if no changes | |
git commit -m "docs: update benchmark results" || exit 0 | |
git push -u github main | |
test: | |
name: Run library tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Git repository | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
# Required due to a limitation in setup-node https://github.com/actions/setup-node/issues/480#issuecomment-1820622085 | |
run: corepack enable | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Install dependencies with Yarn | |
run: yarn install --immutable | |
- name: Build package | |
run: yarn run build | |
- name: Run tests | |
run: yarn test | |
env: | |
NODE_ENV: production | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Git repository | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
# Required due to a limitation in setup-node https://github.com/actions/setup-node/issues/480#issuecomment-1820622085 | |
run: corepack enable | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Install dependencies with Yarn | |
run: yarn install --immutable | |
- name: Build package | |
run: yarn run build | |
style: | |
name: Check style | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Git repository | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
# Required due to a limitation in setup-node https://github.com/actions/setup-node/issues/480#issuecomment-1820622085 | |
run: corepack enable | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Install dependencies with Yarn | |
run: yarn install --immutable | |
- name: Check style with Prettier | |
run: yarn run style |