Skip to content

ci(action): update github/codeql-action action to v2.22.8 #400

ci(action): update github/codeql-action action to v2.22.8

ci(action): update github/codeql-action action to v2.22.8 #400

Workflow file for this run

name: Test
on:
push:
branches:
- renovate/** # branches generated by https://github.com/apps/renovate
pull_request:
branches:
- main
- beta
- '+([0-9])?(.{+([0-9]),x}).x'
workflow_call:
permissions:
contents: read
jobs:
# prevent duplicate checks on Renovate PRs
prevent-duplicate-checks:
runs-on: ubuntu-latest
steps:
- uses: insurgent-lab/is-in-pr-action@3e01b38aa0d2a0e51bbc84540300303ec850e80d # v0.1.5
id: isInPR
outputs:
should-run: ${{ !(steps.isInPR.outputs.result == 'true' && startsWith(github.ref, 'refs/heads/renovate/')) }}
test_matrix:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [16, 18, 20]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
needs: prevent-duplicate-checks
if: ${{ needs.prevent-duplicate-checks.outputs.should-run == 'true' }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Checkout project
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install packages
run: npm ci
- name: Audit npm signatures
run: npm audit signatures
- name: Check codestyle compliance
run: npm run lint
- name: Build project
run: npm run build
- name: Run tests
run: npm run test
- name: Run fuzz tests
run: npm run test:fuzz
# separate job to set as required status check in branch protection
required_check:
runs-on: ubuntu-latest
needs:
- prevent-duplicate-checks
- test_matrix
if: ${{ !cancelled() && needs.prevent-duplicate-checks.outputs.should-run == 'true' }}
steps:
- name: All required jobs and matrix versions passed
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Some required jobs or matrix versions failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1