CI #54
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- next | |
- 'v*' | |
pull_request: {} | |
schedule: | |
- cron: '0 3 * * *' # daily, at 3am | |
concurrency: | |
group: ci-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: Node 18.x - ubuntu | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: volta-cli/action@v4 | |
- name: install dependencies | |
run: npm ci | |
- run: npm run lint | |
- run: npm run test:jest | |
- run: npm run update && git diff --exit-code | |
nodeX: | |
name: Node ${{ matrix.node-version }} - ${{ matrix.os }} | |
runs-on: ${{ matrix.os }}-latest | |
timeout-minutes: 15 | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
strategy: | |
matrix: | |
os: [ubuntu, windows] | |
node-version: [14.x, 16.x, 18.x, 19.x] | |
# excluded because it is the `test` job above | |
exclude: | |
- os: ubuntu | |
node-version: 18.x | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: volta-cli/action@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: install dependencies | |
run: npm ci | |
# Temporarily exclude `test/unit/get-config-test.js` in Node versions before 16 (TODO: remove eventually). | |
# Tests triggering `resolveProjectConfig` and thus `await import()` for config/plugin loading cause this error: | |
# ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. | |
# Possibly related: https://github.com/facebook/jest/issues/11438 | |
- run: npm run test:jest -- --testPathIgnorePatterns=test/unit/get-config-test.js --testPathIgnorePatterns=test/acceptance/public-api-test.js | |
floating-dependencies: | |
name: Floating Dependencies | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: volta-cli/action@v4 | |
- name: install dependencies | |
run: npm install --no-package-lock | |
- run: npm run test:jest |