v19: Support Jest 30 #8397
This file contains 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
# This workflow will do a clean installation of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
push: | |
branches: [ master, v17, v18, v19 ] | |
pull_request: | |
branches: [ master, v17, v18, v19 ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [18.18.0, 18.x, 20.9.0, 20.x, 22.0.0, 22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Get yarn cache dir | |
id: yarnCache | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js ${{ matrix.node-version }} | |
id: setup-node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-yarn | |
with: | |
path: ${{ steps.yarnCache.outputs.dir }} | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_seconds: 15 | |
max_attempts: 3 | |
on_retry_command: yarn config set registry https://registry.npmjs.org | |
command: yarn install | |
- name: Lint | |
run: yarn lint | |
- name: Test | |
run: yarn test | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
continue-on-error: true | |
with: | |
github-token: ${{ secrets.github_token }} | |
flag-name: run-${{ matrix.node-version }} | |
parallel: true | |
- name: Build | |
run: yarn build | |
- name: CJS test | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_seconds: 15 | |
max_attempts: 3 | |
on_retry_command: yarn config set registry https://registry.npmjs.org | |
command: yarn test:cjs | |
- name: ESM test | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_seconds: 15 | |
max_attempts: 3 | |
on_retry_command: yarn config set registry https://registry.npmjs.org | |
command: yarn test:esm | |
- name: Compatibility test | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_seconds: 15 | |
max_attempts: 3 | |
on_retry_command: yarn config set registry https://registry.npmjs.org | |
command: yarn test:compat | |
- name: Issue 952 # see https://github.com/RobinTail/express-zod-api/issues/952 | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_seconds: 15 | |
max_attempts: 3 | |
on_retry_command: yarn config set registry https://registry.npmjs.org | |
command: yarn test:952 | |
finish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
continue-on-error: true | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true |