kostenkoslava/frontend-project-lvl2

View on GitHub
.github/workflows/hexlet-check.yml

Summary

Maintainability
Test Coverage
name: hexlet-check

# Trigger the workflow on push or pull request
on:
  - push
  - pull_request

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
         # Check-out repository under GitHub workspace
        # https://github.com/actions/checkout
      - uses: actions/checkout@v2
        # Step's name
      - name: Use Node.js ${{ matrix.node-version }}
        # Configures the node version used on GitHub-hosted runners
        # https://github.com/actions/setup-node
        uses: actions/setup-node@v1
        # The Node.js version to configure
        with:
          node-version: ${{ matrix.node-version }}
      - name: npm install, build
        # Install and build project
        run: |
          make setup
        # Add environment variables
        env:
          CI: true
      - name: Run linter
        # Run Linter
        run: |
          make lint
      - name: Test & publish code coverage
        # Publish code coverage on Code Climate
        # https://github.com/paambaati/codeclimate-action
        uses: paambaati/codeclimate-action@v2.7.4
        # Add Code Climate secret key
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
        with:
          coverageCommand: make test-coverage
          debug: true