From aa40821e868841b45f6561b7ab582da72bb0f24f Mon Sep 17 00:00:00 2001 From: Tyler Krys Date: Sun, 31 May 2026 19:01:22 -0700 Subject: [PATCH 1/2] Add .nvmrc for React component --- src/react/.nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/react/.nvmrc diff --git a/src/react/.nvmrc b/src/react/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/src/react/.nvmrc @@ -0,0 +1 @@ +24 From 5446c8023c0a0c108541c7d5ea34ad8dbf19c626 Mon Sep 17 00:00:00 2001 From: Tyler Krys Date: Sun, 31 May 2026 19:42:36 -0700 Subject: [PATCH 2/2] Add workflow to test React component --- .github/workflows/test-react.yaml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/test-react.yaml diff --git a/.github/workflows/test-react.yaml b/.github/workflows/test-react.yaml new file mode 100644 index 0000000..db3f642 --- /dev/null +++ b/.github/workflows/test-react.yaml @@ -0,0 +1,54 @@ +--- +name: Test React components library +permissions: + contents: read + +on: + pull_request: + paths: + - src/react/** + workflow_dispatch: + +jobs: + test: + name: React tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./src/react + + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Read .nvmrc + run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV + + - name: Set up Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ env.GITHUB_NVMRC_VERSION }} + + - name: Install dependencies + run: npm ci + + # Errors in lint process will cause this job to fail + - name: Lint + run: npm run lint + + # Errors in Prettier format check will cause this job to fail + - name: Prettier format check + run: npm run format:check + + - name: Run test suite + run: npm run test + + # Treat failures in the Vite build as test failures. + # We don't need to keep the artifact of this build, + # we just care that it completes successfully. + - name: Run Vite build + run: npm run build-vite + + # Treat failures in the main build script as test failures + - name: Run build + run: npm run build