[Snyk] Security upgrade mocha from 9.2.2 to 11.0.1 #215
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: Continuous Integration | |
'on': | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline | |
- name: Format | |
run: npm run format | |
lint-javascript: | |
name: Lint JavaScript | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline | |
- name: Lint | |
run: npm run lint:js | |
lint-typescript: | |
name: Lint TypeScript declaration files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline | |
- name: Lint | |
run: | | |
npm run lint:ts | |
# verify against ranges defined as supported in engines.node | |
test_matrix: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- 10 | |
- 12 | |
- 14 | |
- 16 | |
- 18 | |
- 20 | |
os: | |
- macos-latest | |
- ubuntu-latest | |
- windows-latest | |
exclude: | |
- node-version: 10 | |
os: macos-latest | |
- node-version: 12 | |
os: macos-latest | |
- node-version: 14 | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline | |
- name: Test | |
run: npm run test | |
- name: Test jest | |
run: npm run test:jest | |
if: matrix.node-version >= 14 | |
# separate job to set as required in branch protection, | |
# as the build names above change each time Node versions change | |
test: | |
runs-on: ubuntu-latest | |
needs: | |
- test_matrix | |
if: ${{ !cancelled() }} | |
steps: | |
- name: All matrix versions passed | |
if: ${{ !(contains(needs.*.result, 'failure')) }} | |
run: exit 0 | |
- name: Some matrix version failed | |
if: ${{ contains(needs.*.result, 'failure') }} | |
run: exit 1 |