Skip to content

Commit

Permalink
feat(circleci): add circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerhot95 committed Nov 1, 2022
1 parent 102d838 commit 73379e4
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 21 deletions.
105 changes: 105 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@

version: 2.1
orbs:
commitlint: conventional-changelog/[email protected]

executors:
default-executor:
docker:
- image: "cimg/node:lts"
working_directory: ~/project
resource_class: medium

commands:
restore_test_cache:
steps:
- restore_cache:
keys:
- v1-deps-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}
- v1-deps-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
- v1-deps-
save_test_cache:
steps:
- save_cache:
key: v1-deps-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}
paths:
- node_modules
- ~/.npm
setup:
steps:
- run:
name: Setup
command: |
npm prune
test:
steps:
- run:
name: Test
command: |
npm run test
deploy:
steps:
- run:
name: Deploy
command: |
npm run semantic-release
jobs:
build-and-test:
executor: default-executor
steps:
- checkout
- restore_test_cache
- setup
- save_test_cache
- test
- persist_to_workspace:
root: ~/project
paths: .
deploy:
executor: default-executor
steps:
- attach_workspace:
at: ~/project
- deploy

workflows:
commitlint:
when:
not:
or:
- equal: [ master, <<pipeline.git.branch>> ]
- equal: [ develop, <<pipeline.git.branch>> ]
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
jobs:
- commitlint/lint:
target-branch: master

build-and-test-workflow:
when:
not:
or:
- equal: [ master, <<pipeline.git.branch>> ]
- equal: [ develop, <<pipeline.git.branch>> ]
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
jobs:
- build-and-test

deploy-workflow:
when:
or:
- equal: [ master, <<pipeline.git.branch>> ]
- equal: [ develop, <<pipeline.git.branch>> ]
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
- matches: { pattern: "^v[0-9]*.[0-9]*.[0-9]*$", value: <<pipeline.git.branch>> }

jobs:
- build-and-test
- deploy:
context:
- scratch-npm-creds
requires:
- build-and-test
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# scratch-parser

#### Parser for Scratch projects
[![CircleCI](https://circleci.com/gh/LLK/scratch-parser/tree/develop.svg?style=shield&circle-token=8bf55740611abf98152feec3797bac5ee4149c7c)](https://circleci.com/gh/LLK/scratch-parser?branch=develop)

[![Build Status](https://travis-ci.org/LLK/scratch-parser.svg?branch=develop)](https://travis-ci.org/LLK/scratch-parser)
[![dependencies Status](https://david-dm.org/llk/scratch-parser/status.svg)](https://david-dm.org/llk/scratch-parser)
[![devDependencies Status](https://david-dm.org/llk/scratch-parser/dev-status.svg)](https://david-dm.org/llk/scratch-parser?type=dev)

Expand Down

0 comments on commit 73379e4

Please sign in to comment.