mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
chore: improve ci workflow (#319)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
This commit is contained in:
parent
cb7f079ac4
commit
72ae30de08
120
.github/workflows/ci.yml
vendored
Normal file
120
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [14]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --immutable
|
||||
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest] # TODO: add windows-latest by #408
|
||||
node: [14]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --immutable
|
||||
|
||||
- name: Stub
|
||||
run: yarn stub
|
||||
|
||||
- name: Test (presets)
|
||||
run: yarn test:presets
|
||||
|
||||
test-compat:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest] # TODO: add windows-latest by #408
|
||||
node: [14]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: |
|
||||
yarn.lock
|
||||
test/fixtures/compat/yarn.lock
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --immutable
|
||||
|
||||
- name: Install dependencies (compat fixture)
|
||||
run: yarn --immutable && cd test/fixtures/compat && yarn --immutable
|
||||
|
||||
- name: Stub
|
||||
run: yarn stub
|
||||
|
||||
- name: Test (presets compat)
|
||||
run: yarn test:compat
|
||||
|
||||
build-release:
|
||||
needs:
|
||||
- test
|
||||
- test-compat
|
||||
- lint
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [14]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --immutable
|
||||
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
- name: Release Edge
|
||||
if: |
|
||||
github.event_name == 'push' &&
|
||||
!contains(github.event.head_commit.message, '[skip-release]') &&
|
||||
!contains(github.event.head_commit.message, 'chore') &&
|
||||
!contains(github.event.head_commit.message, 'docs')
|
||||
run: ./scripts/release-edge.sh
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
|
46
.github/workflows/test-compat.yml
vendored
46
.github/workflows/test-compat.yml
vendored
@ -1,46 +0,0 @@
|
||||
name: test-compat
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test-compat:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [14]
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: |
|
||||
.yarn
|
||||
test/fixtures/compat/.yarn
|
||||
key: ${{ runner.os }}-yarn-compat-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-compat-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: yarn --immutable && cd test/fixtures/compat && yarn --immutable
|
||||
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
- name: Test
|
||||
run: TEST_COMPAT=1 yarn test:presets
|
53
.github/workflows/test.yml
vendored
53
.github/workflows/test.yml
vendored
@ -1,53 +0,0 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [14]
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: .yarn
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: yarn --immutable
|
||||
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
- name: Test
|
||||
run: yarn test:presets
|
||||
|
||||
- name: Release Edge
|
||||
if: github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip-release]')
|
||||
run: ./scripts/release-edge.sh
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
|
@ -1,4 +1,5 @@
|
||||
import { resolve } from 'path'
|
||||
import { pathToFileURL } from 'url'
|
||||
import destr from 'destr'
|
||||
import { listen } from 'listhen'
|
||||
import { $fetch } from 'ohmyfetch/node'
|
||||
@ -9,7 +10,7 @@ import { fixtureDir, resolveWorkspace } from '../utils.mjs'
|
||||
const isCompat = Boolean(process.env.TEST_COMPAT)
|
||||
|
||||
export function importModule (path) {
|
||||
return import(path)
|
||||
return import(pathToFileURL(path).href)
|
||||
}
|
||||
|
||||
export function setupTest (preset) {
|
||||
|
Loading…
Reference in New Issue
Block a user