From 73379e431874243944250d975e352b2707bdc82e Mon Sep 17 00:00:00 2001 From: meyerhot95 Date: Tue, 1 Nov 2022 13:04:17 -0400 Subject: [PATCH] feat(circleci): add circleci --- .circleci/config.yml | 105 +++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 20 --------- README.md | 2 +- 3 files changed, 106 insertions(+), 21 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..96d0e36 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,105 @@ + +version: 2.1 +orbs: + commitlint: conventional-changelog/commitlint@1.0.0 + +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, <> ] + - equal: [ develop, <> ] + - matches: { pattern: "^hotfix.*", value: <> } + - matches: { pattern: "^release.*", value: <> } + jobs: + - commitlint/lint: + target-branch: master + + build-and-test-workflow: + when: + not: + or: + - equal: [ master, <> ] + - equal: [ develop, <> ] + - matches: { pattern: "^hotfix.*", value: <> } + - matches: { pattern: "^release.*", value: <> } + jobs: + - build-and-test + + deploy-workflow: + when: + or: + - equal: [ master, <> ] + - equal: [ develop, <> ] + - matches: { pattern: "^hotfix.*", value: <> } + - matches: { pattern: "^release.*", value: <> } + - matches: { pattern: "^v[0-9]*.[0-9]*.[0-9]*$", value: <> } + + jobs: + - build-and-test + - deploy: + context: + - scratch-npm-creds + requires: + - build-and-test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b38a7f9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: false -language: node_js -cache: - directories: - - node_modules - - ~/.npm -notifications: - email: false -node_js: - - 'node' -before_script: - - npm prune -script: - - commitlint-travis - - npm test -after_success: - - npm run semantic-release -branches: - except: - - /^v\d+\.\d+\.\d+$/ diff --git a/README.md b/README.md index 0b8cb57..414536f 100644 --- a/README.md +++ b/README.md @@ -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)