chore(actions): speed up windows build (#8265)

This commit is contained in:
Xin Du (Clark) 2020-11-04 13:38:38 +00:00 committed by GitHub
parent 1f9f324963
commit 418405c216
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 32 deletions

View File

@ -48,41 +48,38 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
# TODO: Investigate [error]Process completed with exit code 1. test-unit:
# test-unit: runs-on: ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy: strategy:
# matrix: matrix:
# os: [windows-latest] os: [windows-latest]
# node: [12] node: [12]
# env: env:
# NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: "--max_old_space_size=4096"
# steps: steps:
# - uses: actions/setup-node@v1 - uses: actions/setup-node@v1
# with: with:
# node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
# - name: checkout - name: checkout
# uses: actions/checkout@master uses: actions/checkout@master
# - name: restore workspace cache - name: restore workspace cache
# uses: actions/cache@v1 uses: actions/cache@v2
# with: with:
# path: ./**/node_modules path: |
# key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} node_modules
packages/*/node_modules
packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
# - name: test unit - name: test unit
# run: node node_modules/jest/bin/jest packages -i --coverage --verbose run: yarn test:unit --testPathIgnorePatterns=packages/cli
# - name: codecov needs: setup
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# flags: unittests
# needs: setup
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -113,7 +110,7 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: build - name: build
run: yarn test:fixtures -i run: yarn test:fixtures
- name: cache fixtures - name: cache fixtures
uses: actions/cache@v2 uses: actions/cache@v2
@ -157,5 +154,5 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
- name: test dev - name: test dev
run: yarn test:dev -i run: yarn test:dev
needs: build needs: build

View File

@ -3,12 +3,16 @@ import { common, server } from '../../src/options'
import * as utils from '../../src/utils/' import * as utils from '../../src/utils/'
import * as config from '../../src/utils/config' import * as config from '../../src/utils/config'
import * as constants from '../../src/utils/constants' import * as constants from '../../src/utils/constants'
import { consola } from '../utils' import { consola, localPath } from '../utils'
jest.mock('@nuxt/core') jest.mock('@nuxt/core')
jest.mock('@nuxt/builder') jest.mock('@nuxt/builder')
jest.mock('@nuxt/generator') jest.mock('@nuxt/generator')
jest.mock(localPath('@nuxt/core'))
jest.mock(localPath('@nuxt/builder'))
jest.mock(localPath('@nuxt/generator'))
const allOptions = { const allOptions = {
...common, ...common,
...server ...server

View File

@ -1,9 +1,14 @@
import path from 'path'
import consola from 'consola' import consola from 'consola'
export * from './mocking' export * from './mocking'
export { NuxtCommand } from '../../src' export { NuxtCommand } from '../../src'
consola.mockTypes(() => jest.fn()) consola.mockTypes(() => jest.fn())
const localPath = modulePath => path.resolve(process.cwd(), 'node_modules', modulePath)
export { export {
consola consola,
localPath
} }