romain-gilliotte/timeslot-dag

View on GitHub
.github/workflows/test-cover.yml

Summary

Maintainability
Test Coverage
name: Test and coverage
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  coverage:
    name: Test and coverage
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-node@master
        with:
          node-version: 14
      - run: npm ci
      - uses: paambaati/codeclimate-action@v2.7.2
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
        with:
          coverageCommand: npm run coverage
  
  publish:
    name: Publish
    if: github.event_name == 'push' && github.ref == 'refs/heads/master'
    needs: coverage
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@master
        with:
          node-version: 14
      - run: npm ci
      - run: npx semantic-release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}