Skip to content

Merge pull request #177 from mithi/revert-175-dependabot/npm_and_yarn… #290

Merge pull request #177 from mithi/revert-175-dependabot/npm_and_yarn…

Merge pull request #177 from mithi/revert-175-dependabot/npm_and_yarn… #290

Workflow file for this run

name: build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
# Yarn is included in the list of software installed on the GitHub-hosted Ubuntu
# so there's no need to include a step install Yarn.
- name: Add prettier
run: yarn add prettier --dev
- name: Check code style
run: yarn run prettier --config ./.prettierrc.yaml --check ./src/*
- name: Install project dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Build project
run: yarn build
- name: Test and generate coverage report
run: yarn test --watchAll=false --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: codecov-umbrella
fail_ci_if_error: false