Merge pull request #1506 from DataRecce/fix/happy-dom-mutationobserve… #2495
This file contains hidden or 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: Test JS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "js/**" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "js/**" | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js 26 | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: 'js/.nvmrc' | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 11.1.1 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| working-directory: ./js | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Biome linter | |
| working-directory: ./js | |
| run: pnpm lint | |
| test-and-build: | |
| if: github.actor != 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js 26 | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: 'js/.nvmrc' | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 11.1.1 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| working-directory: ./js | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Jest Tests | |
| working-directory: ./js | |
| run: pnpm test | |
| - name: Build the static files | |
| working-directory: ./js | |
| run: pnpm build |