shahoob/functionKit

View on GitHub
.github/workflows/coverage.yml

Summary

Maintainability
Test Coverage
name: Coverage

on: [push]
jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Node v15
        uses: actions/setup-node@v1
        with:
            node-version: 15
      - name: Install everything
        run: npm ci
      - name: Generate coverage using Jest
        run: npm run testCov
      
      - name: Zip coverage
        uses: montudor/action-zip@v0.1.0
        with:
          args: zip -r coverage.zip coverage

      - name: Upload coverage
        uses: actions/upload-artifact@v2
        with:
          name: coverage
          path: coverage.zip
      
      - name: Upload to coveralls
        uses: coverallsapp/github-action@v1.1.2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          
      - name: Upload to codecov
        uses: codecov/codecov-action@v1
        with:
            token: ${{ secrets.CODECOV_TOKEN }}
            fail_ci_if_error: true