bencevans/node-influx

View on GitHub
.github/workflows/CI.yml

Summary

Maintainability
Test Coverage
name: CI

on: [push, pull_request]

jobs:
  lint:
    name: Check Code Style
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Prettier
        uses: creyD/prettier_action@v4.2
        with:
          prettier_options: --write **/*.{tsx,ts,md}
          commit_message: "style: prettier code"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  test-browser:
    name: "Testing Browser"

    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Reconfigure Git to use HTTP authentication
        run: >
          git config --global url."https://github.com/".insteadOf
          ssh://git@github.com/

      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: "16"

      - name: Install depencencies
        run: npm ci

      - name: Run InfluxDB
        run: docker run -d -p 8083:8083 -p 8086:8086 influxdb:1.8

      - name: Run tests in browser
        run: npm run test:browser

  test-node:
    name: "Testing on Node.js v${{matrix.node}}"

    runs-on: ubuntu-latest

    strategy:
      fail-fast: false

      matrix:
        node: ["16", "17", "18", "19"]

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Reconfigure Git to use HTTP authentication
        run: >
          git config --global url."https://github.com/".insteadOf
          ssh://git@github.com/

      - name: Setup node ${{ matrix.node }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node }}

      - name: Install depencencies
        run: npm ci

      - name: Run InfluxDB
        run: docker run -d -p 8083:8083 -p 8086:8086 influxdb:1.8

      - name: Run tests
        run: npm run test:ci

      - name: Coveralls GitHub Action
        uses: coverallsapp/github-action@1.1.3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}