Skip to content

fix for yarn test:cli #208

fix for yarn test:cli

fix for yarn test:cli #208

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
# TODO(NODE16): Re-enable node16.
# Presently, serverless has _huge_ zips that are way bigger than expected
# on node16 (which also fails tests). We might just upgrade serverless
# first, then reenable tests.
# https://github.com/FormidableLabs/serverless-jetpack/issues/239
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [12.x, 14.x]
steps:
# Checkout
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Caching: root project
- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
# Note: Yarn root cache restore is slow (1:30) on Windows, so only do on Linux.
- name: Use Yarn cache
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-${{ matrix.node-version }}-
yarn-${{ runner.os }}-
- name: Use node_modules cache
id: node-modules-cache
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('./yarn.lock') }}
restore-keys: |
node-modules-${{ runner.os }}-${{ matrix.node-version }}-
node-modules-${{ runner.os }}-
- name: Project installation
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile --non-interactive
env:
CI: true
- name: Checks (lint, unit tests)
run: yarn run check
# Caching: test scenarios
# **Note**: _don't_ use permissive restore-keys because we skip installs
# all together.
- name: Use test/packages node_modules cache
id: test-packages-cache
uses: actions/cache@v2
with:
path: |
test/packages/*/npm/node_modules
test/packages/*/yarn/node_modules
key: test-packages-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('test/packages/*/npm/package-lock.json', 'test/packages/*/yarn/yarn.lock') }}
# Detect if `test/packages/*/*/node_modules` exists in any form and skip
# installs on a per-directory basis.
- name: Benchmark installation
if: steps.test-packages-cache.outputs.cache-hit != 'true'
run: yarn benchmark:ci --skip-if-exists
env:
CI: true
- name: CLI tests
run: yarn test:cli
- name: Benchmark
run: yarn benchmark --parallel
- name: Benchmark tests
run: yarn benchmark:test