ci.yml
This file
Path
.github/workflows/ci.yml
117 lines · 3.2 KiB · YAML
Last changed by
build(deps): bump the github-actions group with 5 updates (#7462)dependabot[bot]before adoption4e65ec9
History of this fileTake it
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118name: ci
on: push: branches: - master - develop - '4.x' - '5.x' - '5.0' paths-ignore: - '*.md' pull_request: workflow_dispatch:
permissions: contents: read
# Cancel in progress workflows# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new runconcurrency: group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" cancel-in-progress: true
jobs: lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 'lts/*'
- name: Install dependencies run: npm install --ignore-scripts --include=dev
- name: Run lint run: npm run lint
test: strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] node-version: [18, 19, 20, 21, 22, 23, 24, 25, 26] # Node.js release schedule: https://nodejs.org/en/about/releases/
name: Node.js ${{ matrix.node-version }} - ${{matrix.os}}
runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ matrix.node-version }}
- name: Configure npm loglevel run: | npm config set loglevel error shell: bash
- name: Install dependencies run: npm install
- name: Output Node and NPM versions run: | echo "Node.js version: $(node -v)" echo "NPM version: $(npm -v)"
- name: Run tests shell: bash run: npm run test-ci
- name: Upload code coverage uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }} path: ./coverage/lcov.info retention-days: 1
coverage: needs: test runs-on: ubuntu-latest permissions: contents: read checks: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false
- name: Install lcov shell: bash run: sudo apt-get -y install lcov
- name: Collect coverage reports uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: path: ./coverage pattern: coverage-node-*
- name: Merge coverage reports shell: bash run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
- name: Upload coverage report uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 with: file: ./lcov.info