Files
create-react-component-library/.github/workflows/main-workflow.yml
Alejandro Lembke Barrientos 57815d0949 PR-227028: fix CI — bump Node to 22 and regenerate lock file
- Bump CI Node from 20 to 22 across all jobs. sass-loader@17 requires
  Node >= 22.11, so Node 20 was unsupported (EBADENGINE).
- Regenerate package-lock.json from scratch to fix npm ci failing with
  "Missing: @emnapi/runtime from lock file" — an npm optional-deps issue with
  the oxc/wasm bindings pulled by typescript-eslint's resolver.
2026-06-09 17:47:09 +00:00

80 lines
2.3 KiB
YAML

# This file contains the main workflow for the create-react-component-library project. It defines the steps and actions that are executed when a pull request is opened or pushed to the repository. The workflow includes building and testing the project, as well as deploying it to GitHub Pages if the build is successful.
# Name of the workflow
name: Testing package
# Events that trigger the workflow
on:
push:
branches: [ master ]
pull_request:
branches: ['*']
# Jobs that run as part of the workflow
jobs:
# Job to run unit tests
unit-front-end-testing:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm test
# Job to run Components Cypress tests
cypress-components-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
registry-url: https://registry.npmjs.org/
- name: Cypress install
run: npm i
- name: Cypress run
uses: cypress-io/github-action@v6
with:
install: false
component: true
# Job to build the package
test-build-package:
if: github.ref != 'refs/heads/master'
needs: [ unit-front-end-testing, cypress-components-testing ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
# Job to publish the package to npm
publish-npm:
if: github.ref == 'refs/heads/master'
needs: [ unit-front-end-testing, cypress-components-testing ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --access=public
env:
NPM_PERSONAL_TOKEN: ${{secrets.npm_token}}