Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-amblard committed Jul 30, 2020
1 parent 66ade3f commit 4066607
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ aliases:
working_directory: ~/repo
docker:
- image: circleci/node:12.5.0

- &test_tag_filter
filters:
tags:
ignore: /.*/

- &canary_tag_filter
filters:
tags:
only: /^v[\d\.]+-(canary|alpha|beta)\.\d$/
branches:
ignore: /.*/

- &prod_tag_filter
filters:
tags:
only: /^v[\d\.]+$/
branches:
ignore: /.*/

- &attach
attach_workspace:
at: ~/project
Expand All @@ -26,6 +46,11 @@ aliases:
run:
name: Print package informations
command: echo $CURRENT_PACKAGE_NAME@$CURRENT_PACKAGE_VERSION
- &persist
persist_to_workspace:
root: ~/repo
paths:
- .

jobs:
tests:
Expand Down Expand Up @@ -74,10 +99,7 @@ jobs:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- persist_to_workspace:
root: ~/repo
paths:
- .
- *persist

publish-canary:
<<: *defaults
Expand All @@ -90,10 +112,7 @@ jobs:
- run:
name: Publish package
command: npm publish --tag canary
- persist_to_workspace:
root: ~/repo
paths:
- .
- *persist

publish:
<<: *defaults
Expand All @@ -112,45 +131,28 @@ jobs:
paths:
- .


workflows:
version: 2
tests:
jobs:
- tests:
filters:
tags:
ignore: /.*/
<<: *test_tag_filter

test-publish-canary:
jobs:
- tests:
filters:
tags:
only: /^v[\d\.]+-(canary|alpha|beta)\.\d$/
branches:
ignore: /.*/
<<: *canary_tag_filter
- publish-canary:
requires:
- tests
filters:
tags:
only: /^v[\d\.]+-(canary|alpha|beta)\.\d$/
branches:
ignore: /.*/
<<: *canary_tag_filter

test-publish:
jobs:
- tests:
filters:
tags:
only: /^v[\d\.]+$/
branches:
ignore: /.*/
<<: *prod_tag_filter
- publish:
requires:
- tests
filters:
tags:
only: /^v[\d\.]+$/
branches:
ignore: /.*/
<<: *prod_tag_filter

0 comments on commit 4066607

Please sign in to comment.