name: Build, lint and test

on: [push, pull_request]

jobs:
  build_lint_test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1
      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 10.x
      - name: Build, lint and test
        run: |
          yarn
          yarn lint
          yarn test
          yarn dist
        if: |
          contains(github.event.commits[0].message, '[skip ci]') == false &&
          contains(github.event.commits[0].message, '[ci skip]') == false

name: Build, lint and test

on: [push, pull_request]

jobs:
  build_lint_test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1
      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 10.x
      - name: Get yarn cache
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - uses: actions/cache@v1
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: ${{ runner.os }}-yarn-
      - name: Build, lint and test
        run: |
          yarn
          yarn lint
          yarn test
          yarn dist
        if: |
          contains(github.event.commits[0].message, '[skip ci]') == false &&
          contains(github.event.commits[0].message, '[ci skip]') == false

Add yarn cache to GitHub actions
chore: Add yarn cache to GitHub actions
