name: ci on: push: branches: - master paths-ignore: - '*.md' pull_request: paths-ignore: - '*.md' 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 run concurrency: 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@v6 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: "lts/*" - name: Install dependencies run: npm install --ignore-scripts --include=dev - name: Run lint run: npm run lint test: name: Test - Node.js ${{ matrix.node-version }} - ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] # Node.js release schedule: https://nodejs.org/en/about/releases/ node-version: [18, 19, 20, 21, 22, 23, 24, 25] steps: - uses: actions/checkout@v6 - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: check-latest: true node-version: ${{ matrix.node-version }} - name: Configure npm loglevel run: npm config set loglevel error - name: Install dependencies run: npm install - name: Run tests run: npm run test-ci - name: Upload code coverage uses: actions/upload-artifact@v5 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@v6 - name: Install lcov run: sudo apt-get -y install lcov - name: Collect coverage reports uses: actions/download-artifact@v6 with: path: ./coverage pattern: coverage-node-* - name: Merge coverage reports run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info - name: Upload coverage report uses: coverallsapp/github-action@v2 with: file: ./lcov.info