mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
f73bbe25ee
<!--- Provide a general summary of your changes in the title above --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (a non-breaking change which fixes an issue) - [ ] New feature (a non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Description <!--- Describe your changes in detail --> <!--- Why is this change required? What problem does it solve? --> <!--- If it resolves an open issue, please link to the issue here. For example "Resolves: #1337" --> ## Checklist: <!--- Put an `x` in all the boxes that apply. --> <!--- If your change requires a documentation PR, please link it appropriately --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. (PR: #) - [ ] I have added tests to cover my changes (if not applicable, please state why) - [ ] All new and existing tests are passing.
149 lines
3.0 KiB
YAML
Executable File
149 lines
3.0 KiB
YAML
Executable File
version: 2
|
|
|
|
defaults: &defaults
|
|
working_directory: ~/project/nuxt
|
|
docker:
|
|
- image: banian/node-headless-chrome
|
|
|
|
jobs:
|
|
setup:
|
|
<<: *defaults
|
|
steps:
|
|
# Checkout repository
|
|
- checkout
|
|
|
|
# Restore cache
|
|
- restore_cache:
|
|
key: yarn-{{ checksum "yarn.lock" }}
|
|
|
|
# Install dependencies
|
|
- run:
|
|
name: Install Dependencies
|
|
command: NODE_ENV=dev yarn
|
|
|
|
# Keep cache
|
|
- save_cache:
|
|
key: yarn-{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- "node_modules"
|
|
|
|
# Persist files
|
|
- persist_to_workspace:
|
|
root: ~/project
|
|
paths:
|
|
- nuxt
|
|
|
|
lint:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: Lint
|
|
command: yarn test:lint
|
|
|
|
audit:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: Security Audit
|
|
command: npm install --package-lock-only && npm audit --audit-level=moderate
|
|
|
|
build:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: Build Fixtures
|
|
command: yarn build && yarn test:fixtures -w=4 --coverage && yarn coverage
|
|
- persist_to_workspace:
|
|
root: ~/project
|
|
paths:
|
|
- nuxt/test/fixtures
|
|
- nuxt/dist
|
|
environment:
|
|
- NODE_ENV: "test"
|
|
|
|
test-unit:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: Unit Test
|
|
command: yarn test:unit -w=4 --coverage && yarn coverage
|
|
environment:
|
|
- NODE_ENV: "test"
|
|
|
|
test-e2e:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: E2E Test
|
|
command: yarn test:e2e && yarn coverage
|
|
environment:
|
|
- NODE_ENV: "test"
|
|
|
|
release:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: release
|
|
command: |
|
|
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
BUILD_SUFFIX=edge yarn build
|
|
npm publish
|
|
for p in packages/*; do
|
|
if [ -f "$p/package.json" ]; then
|
|
cd $p
|
|
npm publish
|
|
cd -
|
|
fi
|
|
done
|
|
|
|
workflows:
|
|
version: 2
|
|
setup-and-parallel-test:
|
|
jobs:
|
|
- setup
|
|
|
|
- lint:
|
|
requires:
|
|
- setup
|
|
|
|
- audit:
|
|
requires:
|
|
- setup
|
|
|
|
- build:
|
|
requires:
|
|
- setup
|
|
|
|
- test-unit:
|
|
requires:
|
|
- build
|
|
|
|
- test-e2e:
|
|
requires:
|
|
- build
|
|
|
|
- release:
|
|
requires:
|
|
- build
|
|
- lint
|
|
- audit
|
|
- test-unit
|
|
- test-e2e
|
|
filters:
|
|
branches:
|
|
only:
|
|
- dev
|