website-scraper/node-website-scraper

View on GitHub
.github/workflows/node.js.yml

Summary

Maintainability
Test Coverage
name: Node.js CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  schedule:
    - cron: '13 2 * * *'

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        node-version:
          - 18
          - 20
          - current
        os:
          - ubuntu-latest
          - windows-latest
        include:
          - node-version: 20
            os: macos-latest

    steps:
      - uses: actions/checkout@v4
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm i
      - run: npm test
      - run: npm run eslint
        if: ${{ matrix.node-version == '20' && matrix.os == 'ubuntu-latest' }}
      - name: Coveralls
        if: ${{ matrix.node-version == '20' && matrix.os == 'ubuntu-latest' }}
        uses: coverallsapp/github-action@master
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Publish codeclimate code coverage
        if: ${{ matrix.node-version == '20' && matrix.os == 'ubuntu-latest' }}
        uses: paambaati/codeclimate-action@v6.0.0
        env:
          CC_TEST_REPORTER_ID: 5a58ca8fc3a280bcb3e9cc6af2588c2e24608abc50d89d749c4453b5ebbbd31b
        with:
          coverageLocations: |
            ${{github.workspace}}/coverage/lcov.info:lcov