diff --git a/.github/workflows/test_react_component_library.yaml b/.github/workflows/test_react_component_library.yaml new file mode 100644 index 00000000..a09ad07d --- /dev/null +++ b/.github/workflows/test_react_component_library.yaml @@ -0,0 +1,36 @@ +name: Run test suite for React component library + +on: + pull_request: + paths: + - packages/react-components/** + workflow_dispatch: + +# Cancel any currently running builds to save GitHub Actions hours. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + react-components-test: + name: Test suite run + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Read .nvmrc + run: echo "::set-output name=NVMRC::$(cat .nvmrc)" + id: nvm + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ steps.nvm.outputs.NVMRC }}" + + - name: Install dependencies + run: npm install + + - name: Run test suite with npm script + run: npm run test:ci diff --git a/packages/react-components/.nvmrc b/packages/react-components/.nvmrc index 9a2a0e21..209e3ef4 100644 --- a/packages/react-components/.nvmrc +++ b/packages/react-components/.nvmrc @@ -1 +1 @@ -v20 +20