name: Unit Tests on: push: branches: - main pull_request: merge_group: permissions: contents: read jobs: node-tests: strategy: fail-fast: false matrix: node_version: - 22.15.0 - 22 - 24 - 26 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: cache: 'npm' cache-dependency-path: | package-lock.json node-version: ^26.3.0 - name: Bootstrap run: npm ci --ignore-scripts - name: Build 🔧 run: npm run compile # The compile above runs on the repo's pinned build Node (^26.3.0). # Switch to the matrix Node version so tests exercise every supported # runtime. - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: ${{ matrix.node_version }} - run: npm test - name: Report Coverage uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: verbose: true node-windows-tests: runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: cache: 'npm' cache-dependency-path: | package-lock.json node-version: ^26.3.0 - name: Bootstrap run: npm ci --ignore-scripts - name: Build 🔧 run: | npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe" npm run compile - name: Unit tests run: npm run test verify-pack: # Unit tests run against TS source via ts-node, so they never exercise # the published dist/ artifact. This job packs every workspace package, # loads the require/import targets of its `exports` map, and existence # checks types/browser/main/module files in the tarball. runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: cache: 'npm' cache-dependency-path: | package-lock.json node-version: ^26.3.0 - name: Bootstrap run: npm ci --ignore-scripts - name: Build 🔧 run: npm run compile - name: Verify packed artifacts run: npm run verify-pack browser-tests: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: cache: 'npm' cache-dependency-path: | package-lock.json node-version: ^26.3.0 - name: Bootstrap run: npm ci --ignore-scripts - name: Build 🔧 run: npm run compile - name: Unit tests run: npm run test:browser - name: Report Coverage uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: verbose: true webworker-tests: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: cache: 'npm' cache-dependency-path: | package-lock.json node-version: ^26.3.0 - name: Bootstrap run: npm ci --ignore-scripts - name: Build 🔧 run: npm run compile - name: Unit tests run: npm run test:webworker - name: Report Coverage uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: verbose: true # The release scripts are not part of any workspace, so `npm test` does not cover # them. They are only ever run by maintainers on a pinned Node version, so unlike # the packages there is no need to run them across the whole matrix. scripts-tests: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: cache: 'npm' cache-dependency-path: | package-lock.json node-version: ^26.3.0 - name: Bootstrap run: npm ci --ignore-scripts - name: Unit tests run: npm run test:scripts