name: CI on: pull_request: push: branches: main jobs: check: name: Checks runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Checkout Repo uses: actions/checkout@v2 with: fetch-depth: 0 - name: Setup Node uses: actions/setup-node@v1 with: node-version: '14' - name: Get Yarn cache directory id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - name: Use Yarn cache uses: actions/cache@v2 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: Use node_modules cache id: node-modules-cache uses: actions/cache@v2 with: path: node_modules key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} - name: Install Dependencies if: | steps.yarn-cache.outputs.cache-hit != 'true' || steps.node-modules-cache.outputs.cache-hit != 'true' run: yarn install --prefer-offline --frozen-lockfile --non-interactive --silent - name: Linting run: yarn run lint - name: Unit Tests run: yarn run test --maxWorkers=2 - name: Build run: yarn run build