name: Frontend CI

on:
  push:
    paths:
    - 'frontend/**'

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x]

    steps:
    - uses: actions/checkout@v1
    - name: use node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      working-directory: ./frontend
      with:
        node-version: ${{ matrix.node-version }}
    - name: yarn install, build, and test
      working-directory: ./frontend
      run: |
        yarn install
        yarn build --if-present
        yarn test
      env:
        CI: true
