mirror of
https://github.com/postlight/mercury-parser
synced 2024-10-31 03:20:40 +00:00
03c7040065
CI config needs filters on all jobs referenced from jobs with filters
94 lines
2.2 KiB
YAML
94 lines
2.2 KiB
YAML
version: 2
|
|
|
|
defaults: &defaults
|
|
working_directory: ~/repo
|
|
docker:
|
|
- image: circleci/node:8.10-browsers
|
|
|
|
jobs:
|
|
test-node:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
# For some reason phantomjs-prebuild is failing w/yarn, but npm installing works
|
|
- run: 'npm install phantomjs-prebuilt'
|
|
- run: 'yarn install'
|
|
- run: 'yarn lint:ci'
|
|
- run: 'yarn build:ci'
|
|
- run: 'yarn test:node --maxWorkers=4'
|
|
- run: './scripts/pr-parser-preview.sh'
|
|
- store_artifacts:
|
|
path: tmp/artifacts
|
|
- persist_to_workspace:
|
|
root: ~/repo
|
|
paths: .
|
|
|
|
test-web:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/repo
|
|
- checkout
|
|
- run: 'yarn install'
|
|
- run: 'yarn add karma-cli --dev'
|
|
- run: 'yarn test:web --maxWorkers=4'
|
|
- run: 'yarn build:web:ci --maxWorkers=4'
|
|
|
|
deploy:
|
|
<<: *defaults
|
|
steps:
|
|
- attach_workspace:
|
|
at: ~/repo
|
|
- run:
|
|
name: Authenticate with registry
|
|
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
|
|
- run:
|
|
name: Publish package
|
|
command: npm publish --access public
|
|
|
|
update-fixtures:
|
|
docker:
|
|
- image: circleci/node:8.10
|
|
steps:
|
|
- checkout
|
|
- run: 'yarn install'
|
|
- run: 'node ./scripts/update-fixtures.js'
|
|
|
|
workflows:
|
|
version: 2
|
|
build_and_test:
|
|
jobs:
|
|
- test-node:
|
|
filters: # required since `deploy` has tag filters AND requires `test-node`
|
|
branches:
|
|
only: /.*/
|
|
tags:
|
|
only: /.*/
|
|
- test-web:
|
|
filters: # required since `deploy` has tag filters AND requires `test-web`
|
|
branches:
|
|
only: /.*/
|
|
tags:
|
|
only: /.*/
|
|
- deploy:
|
|
requires:
|
|
- test-node
|
|
- test-web
|
|
filters:
|
|
tags:
|
|
only: /^v.*/
|
|
branches:
|
|
ignore: /.*/
|
|
# UNCOMMENT WHEN READY TO AUTOMATE THIS TASK
|
|
# scheduled_tasks:
|
|
# triggers:
|
|
# # run once per hour
|
|
# - schedule:
|
|
# cron: "0 * * * *"
|
|
# filters:
|
|
# branches:
|
|
# only:
|
|
# - master
|
|
# jobs:
|
|
# - update-fixtures
|