2020-01-13 16:33:01 +00:00
|
|
|
name: test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
- 2.x
|
|
|
|
- next
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- dev
|
2020-02-28 11:55:38 +00:00
|
|
|
- 2.x
|
2020-01-13 16:33:01 +00:00
|
|
|
- next
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
setup:
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-02-28 11:55:38 +00:00
|
|
|
if: github.event_name == 'push' || !(github.base_ref == '2.x' && github.head_ref == 'dev')
|
2020-01-13 16:33:01 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node: [10, 12]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
2020-03-03 13:08:59 +00:00
|
|
|
uses: actions/checkout@v2
|
2020-02-26 14:13:16 +00:00
|
|
|
with:
|
2020-03-03 13:05:52 +00:00
|
|
|
fetch-depth: 0 # All history
|
|
|
|
|
|
|
|
- name: fetch tags
|
|
|
|
run: git fetch --depth=1 origin "+refs/tags/*:refs/tags/*"
|
2020-01-13 16:33:01 +00:00
|
|
|
|
|
|
|
- name: cache node_modules
|
|
|
|
id: node_modules_cache_id
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: node_modules
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
|
|
|
|
|
|
|
|
- name: install
|
2020-01-13 18:39:20 +00:00
|
|
|
run: yarn --check-files --frozen-lockfile --non-interactive
|
2020-01-13 16:33:01 +00:00
|
|
|
|
|
|
|
- name: cache workspace
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
|
|
|
lint:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node: [12]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
|
|
|
- name: lint
|
|
|
|
run: yarn test:lint
|
|
|
|
needs: setup
|
|
|
|
|
|
|
|
audit:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node: [12]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
|
|
|
- name: audit
|
2020-01-14 22:15:45 +00:00
|
|
|
run: yarn run audit
|
2020-01-13 16:33:01 +00:00
|
|
|
needs: setup
|
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
test-unit:
|
2020-01-13 16:33:01 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node: [10, 12]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
- name: test unit
|
|
|
|
run: yarn test:unit --coverage
|
2020-01-13 16:33:01 +00:00
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
- name: codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
if: matrix.os == 'ubuntu-latest' && matrix.node == '10'
|
2020-01-13 16:33:01 +00:00
|
|
|
with:
|
2020-01-20 23:30:48 +00:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
flags: unittests
|
2020-01-13 16:33:01 +00:00
|
|
|
needs: setup
|
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
build:
|
2020-01-13 16:33:01 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-01-20 23:30:48 +00:00
|
|
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
2020-01-13 16:33:01 +00:00
|
|
|
os: [ubuntu-latest]
|
2020-01-20 23:30:48 +00:00
|
|
|
node: [10, 12]
|
2020-01-13 16:33:01 +00:00
|
|
|
|
2020-01-31 14:28:27 +00:00
|
|
|
env:
|
|
|
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
|
|
|
|
2020-01-13 16:33:01 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
- name: build
|
|
|
|
run: yarn test:fixtures -i
|
|
|
|
|
|
|
|
- name: cache fixtures
|
2020-01-13 16:33:01 +00:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: test/fixtures
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
|
2020-01-20 23:30:48 +00:00
|
|
|
needs: setup
|
2020-01-13 16:33:01 +00:00
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
lint-app:
|
2020-01-13 16:33:01 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
2020-01-20 23:30:48 +00:00
|
|
|
node: [12]
|
2020-01-13 16:33:01 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
|
|
|
- name: restore fixtures
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: test/fixtures
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
|
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
- name: lint app
|
|
|
|
run: yarn lint:app
|
2020-01-13 16:33:01 +00:00
|
|
|
needs: build
|
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
test-dev:
|
2020-01-13 16:33:01 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node: [10, 12]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
|
|
|
- name: restore fixtures
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: test/fixtures
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
|
|
|
|
|
2020-01-20 23:30:48 +00:00
|
|
|
- name: test dev
|
|
|
|
run: yarn test:dev -w=2
|
2020-01-13 16:33:01 +00:00
|
|
|
needs: build
|
|
|
|
|
|
|
|
test-e2e:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node: [10, 12]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
|
|
|
- name: restore fixtures
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: test/fixtures
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
|
|
|
|
|
|
|
|
- name: test e2e
|
|
|
|
run: yarn test:e2e
|
|
|
|
needs: build
|
2020-01-20 20:50:07 +00:00
|
|
|
|
|
|
|
release-commit:
|
|
|
|
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[release]')
|
2020-01-20 21:19:10 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-01-20 20:50:07 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node: [12]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: restore workspace cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
|
|
|
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
|
|
|
|
|
2020-01-20 21:19:10 +00:00
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2020-01-20 21:35:00 +00:00
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2020-01-20 21:19:10 +00:00
|
|
|
|
2020-01-20 20:50:07 +00:00
|
|
|
- name: bump version
|
|
|
|
run: yarn lerna version --yes --no-git-tag-version --no-push
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
run: PACKAGE_SUFFIX=edge yarn build
|
|
|
|
|
|
|
|
- name: publish
|
|
|
|
run: |
|
|
|
|
if [ "$ref" = "refs/heads/next" ]; then tag="--tag next"; fi
|
2020-02-26 12:50:01 +00:00
|
|
|
./scripts/workspace-run npm publish $tag -q
|
2020-01-20 20:50:07 +00:00
|
|
|
env:
|
|
|
|
ref: ${{ github.ref }}
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
|
|
|
|
needs: [lint-app, test-dev, test-unit, test-e2e]
|