2019-11-03 15:18:37 +01:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [10.x, 12.x]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install Yarn
|
2019-11-12 21:43:11 +01:00
|
|
|
run: |
|
|
|
|
npm i yarn --global
|
|
|
|
yarn config set cache-folder $GITHUB_WORKSPACE/.cache/yarn
|
2019-11-12 21:14:42 +01:00
|
|
|
|
2019-11-12 21:20:05 +01:00
|
|
|
- name: Cache node modules
|
2019-11-12 21:14:42 +01:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2019-11-12 21:43:11 +01:00
|
|
|
path: .cache
|
2019-11-12 21:20:05 +01:00
|
|
|
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.OS }}-build-
|
|
|
|
${{ runner.OS }}-
|
|
|
|
|
2019-11-12 21:24:35 +01:00
|
|
|
- name: Install Packages
|
2019-11-12 21:52:50 +01:00
|
|
|
run: yarn install --frozen-lockfile --force
|
2019-11-12 21:43:11 +01:00
|
|
|
env:
|
|
|
|
CYPRESS_CACHE_FOLDER: $GITHUB_WORKSPACE/.cache/cypress
|
2019-11-12 21:24:35 +01:00
|
|
|
|
2019-11-03 15:18:37 +01:00
|
|
|
- name: Run Build
|
|
|
|
run: yarn build
|
|
|
|
|
|
|
|
- name: Run Unit Tests
|
|
|
|
run: |
|
|
|
|
yarn test --coverage
|
|
|
|
cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
|
2019-11-03 18:30:01 +01:00
|
|
|
env:
|
2019-11-03 18:28:27 +01:00
|
|
|
COVERALLS_SERVICE_NAME: ${{ secrets.COVERALLS_SERVICE_NAME }}
|
|
|
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
2019-11-03 15:18:37 +01:00
|
|
|
|
|
|
|
- name: Run E2E Tests
|
|
|
|
run: yarn e2e
|
2019-11-03 19:40:15 +01:00
|
|
|
env:
|
|
|
|
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|