prescottprue/react-google-button

View on GitHub
.github/workflows/verify.yml

Summary

Maintainability
Test Coverage
name: Verify

on: [pull_request]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x, 12.x]
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Get Cache Settings
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Cache Dependencies
        uses: actions/cache@v1
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

      - name: Install Dependencies
        env:
          CI: true
        run: yarn install --frozen-lockfile
 
      - name: Run Unit Tests + Coverage
        run: yarn test:cov

      - name: Build
        run: yarn build

      - name: Upload Coverage
        if: success()
        env:
          CI: true
          CODE_COV: ${{ secrets.CODE_COV }}
        run: |
          # Upload to Code Cover. Curl used in place of codecov/codecov-action
          # due to long build time. See https://github.com/codecov/codecov-action/issues/21
          curl -s https://codecov.io/bash | bash -s -- -t $CODE_COV