add circleCI pipeline

This commit is contained in:
Pooya Parsa 2018-03-19 10:46:11 +03:30
parent ca1242d5ec
commit 731ce56067
3 changed files with 51 additions and 27 deletions

View File

@ -1,9 +1,13 @@
version: 2
defaults: &defaults
working_directory: /usr/src/app
docker:
- image: banian/node-headless-chrome
jobs:
build:
working_directory: /usr/src/app
docker:
- image: banian/node-headless-chrome
install:
<<: *defaults
steps:
# Checkout repository
- checkout
@ -23,17 +27,54 @@ jobs:
paths:
- "node_modules"
# Test
lint:
<<: *defaults
- run:
name: Tests
command: NODE_ENV=test yarn test && yarn coverage
name: ESLint
command: yarn lint
# Release edge
build:
<<: *defaults
- run:
name: Publish nuxt-edge
name: Build Fixtures
command: yarn build-fixtures
test:
<<: *defaults
- run:
name: Test
command: yarn jest test/
release:
- run:
name: release
command: |
if [ "${CIRCLE_BRANCH}" == "dev" ]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc
./scripts/release-edge
fi
workflows:
version: 2
install-and-parallel-test:
jobs:
- install
- lint:
requires:
- install
- build:
requires:
- install
- test:
requires:
- build
- release:
requires:
- build
- lint
- test

View File

@ -1,21 +1,8 @@
module.exports = {
'testEnvironment': 'node',
'coverageDirectory': './coverage/',
'collectCoverage': false,
'setupTestFrameworkScriptFile': './test/utils/setup',
'testMatch': [
'<rootDir>/test/*.test.js'
],
'projects': [
// {
// 'displayName': 'Lint',
// 'runner': 'jest-runner-eslint',
// 'testMatch': [
// '<rootDir>/lib/*.js'
// ]
// },
{
'displayName': 'Test'
}
]
}

View File

@ -42,17 +42,13 @@
},
"scripts": {
"build-fixtures": "node ./scripts/build-fixtures",
"test": "npm run lint && npm run build-fixtures && jest test/",
"test": "npm run build-fixtures && jest",
"test:unit": "jest",
"coverage": "codecov",
"lint": "eslint --ext .js,.mjs,.vue bin/* build/ lib/ test/ examples/",
"precommit": "npm run lint",
"postinstall": "opencollective postinstall || exit 0"
},
"jest": {
"coverageDirectory": "./coverage/",
"collectCoverage": true
},
"engines": {
"node": ">=8.0.0",
"npm": ">=5.0.0"