gkozlenko/sequelize-tokenify

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

Summary

Maintainability
Test Coverage
name: build

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x, 16.x, 18.x, 20.x]

    steps:
    # Setup MySQL
    - uses: mirromutth/mysql-action@v1.1
      with:
        mysql version: '8.0'
        mysql database: 'sequelize_tokenify_test'
        mysql user: 'devuser'
        mysql password: 'devpass'

    # Tests
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci
    - run: npm run lint
    - run: npm run test_with_report

    # Coverage
    - if: |
        matrix.node-version == '20.x' &&
        github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
      name: Update Coverage Badge
      uses: we-cli/coverage-badge-action@main