Skip to content

fix: prevent TypeError when globalThis.window is undefined (#1176) #286

fix: prevent TypeError when globalThis.window is undefined (#1176)

fix: prevent TypeError when globalThis.window is undefined (#1176) #286

Workflow file for this run

name: CI
on:
push:
branches-ignore: ['all-contributors/**']
pull_request:
branches-ignore: ['all-contributors/**']
jobs:
validate:
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.fork
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- id: restore
name: ♻️ Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
yarn.lock
node_modules
key: ${{ hashFiles('package.json') }}
restore-keys: ${{ hashFiles('package.json') }}-
- id: install
if: >
steps.restore.outputs.cache-matched-key == ''
name: πŸ“₯ Install deps
run: yarn
env:
HUSKY_SKIP_INSTALL: true
- if: >
steps.install.outcome == 'success'
name: ♻️ Save node_modules
uses: actions/cache/save@v4
with:
path: |
yarn.lock
node_modules
key: ${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
- name: ✍ Lint
run: npm run lint
- name: πŸ§ͺ Test
run: npm run test -- --coverage
- name: 🚧 Build test environments
run: npm run setup:env
- name: πŸ”¬ Test with toolbox
run: npm run test:toolbox
- name: πŸ— Build
run: npm run build
- name: β˜‚οΈ Upload coverage report
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
needs: validate
runs-on: ubuntu-latest
if: >
github.event_name == 'push' &&
github.repository == 'testing-library/user-event' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/alpha', github.ref)
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ♻️ Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
yarn.lock
node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json') }}
- name: πŸ“₯ Install deps
run: yarn
env:
HUSKY_SKIP_INSTALL: true
- name: πŸ—οΈ Run build script
run: npm run build
- name: πŸš€ Release
uses: ph-fritsche/action-release@v2
with:
dry: ${{ vars.RELEASE_DRY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}