From 8243672ce50ae8226a3b96408dfe713381ef222c Mon Sep 17 00:00:00 2001 From: Nosa Osagiede <106080091+NosakhareOsas@users.noreply.github.com> Date: Mon, 4 Jul 2022 12:40:04 +0100 Subject: [PATCH 01/11] Add .circleci/config.yml --- .circleci/config.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..6554e1f4e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,26 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/2.0/configuration-reference/#jobs +jobs: + say-hello: + # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor + docker: + - image: cimg/base:stable + # Add steps to the job + # See: https://circleci.com/docs/2.0/configuration-reference/#steps + steps: + - checkout + - run: + name: "Say hello" + command: "echo Hello, World!" + +# Invoke jobs via workflows +# See: https://circleci.com/docs/2.0/configuration-reference/#workflows +workflows: + say-hello-workflow: + jobs: + - say-hello From 432f7d4ca4d597b2eeb8b873c50bcb7b5e2d9f73 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede <106080091+NosakhareOsas@users.noreply.github.com> Date: Mon, 4 Jul 2022 12:43:24 +0100 Subject: [PATCH 02/11] Add .circleci/config.yml From d8ea23e8617eeb2c3585f8775cb5ac10d95208d7 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede <106080091+NosakhareOsas@users.noreply.github.com> Date: Mon, 4 Jul 2022 12:44:57 +0100 Subject: [PATCH 03/11] Add .circleci/config.yml From 5ba52ca16c3d909af3f13faa520a7e9e091f1e00 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede Date: Mon, 4 Jul 2022 12:50:18 +0100 Subject: [PATCH 04/11] add commands and anchor --- .circleci/config.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6554e1f4e..3808ead06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,25 +1,36 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/2.0/configuration-reference + version: 2.1 -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/2.0/configuration-reference/#jobs +defaults: &defaults + docker: + - image: cimg/base:stable + working_directory: ~/project + +commands: + print_pipeline_id: + description: "Print pipeline ID" + parameters: + id: + type: string + default: "ID should br here bro" + steps: + - run: + name: print pipeline id now + command: echo <> + jobs: say-hello: - # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor + docker: - image: cimg/base:stable - # Add steps to the job - # See: https://circleci.com/docs/2.0/configuration-reference/#steps + steps: - checkout - run: name: "Say hello" command: "echo Hello, World!" -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows + workflows: say-hello-workflow: jobs: From 38df0219737b7db3ae5d16472fdbe41df074e04c Mon Sep 17 00:00:00 2001 From: Nosa Osagiede Date: Mon, 4 Jul 2022 13:23:52 +0100 Subject: [PATCH 05/11] config complete --- .circleci/config.yml | 67 +++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3808ead06..e320e32b6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,35 +3,64 @@ version: 2.1 defaults: &defaults docker: - - image: cimg/base:stable + - image: cimg/node:13.8.0 working_directory: ~/project commands: - print_pipeline_id: - description: "Print pipeline ID" - parameters: - id: - type: string - default: "ID should br here bro" + npm_install: + description: "installs npm on a job" steps: - run: - name: print pipeline id now - command: echo <> + name: install npm + command: npm i jobs: - say-hello: - - docker: - - image: cimg/base:stable - + build: + <<: *defaults steps: - checkout - - run: - name: "Say hello" - command: "echo Hello, World!" + - npm_install + save_cache: + key: 'npm-packages' + paths: + - /src/tools + - run: + name: install npm lint + command: npm run lint + + test: + <<: *defaults + steps: + - checkout + restore_cache: + key: + - 'npm-packages' + - npm_install + - run: + name: test + command: npm run test + + analyze: + <<: *defaults + steps: + - checkout + restore_cache: + key: + - 'npm-packages' + - npm_install + - run: + name: analyze + command: npm run audit + workflows: - say-hello-workflow: + react-slingshot-workflow: jobs: - - say-hello + - build + - test: + requires: + - build + - analyze: + requires: + - test From b528d69a39a2e1ac407fc9881ed1316d76c2e4d9 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede Date: Mon, 4 Jul 2022 13:28:35 +0100 Subject: [PATCH 06/11] config complete --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e320e32b6..a52e20eee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: steps: - checkout - npm_install - save_cache: + - save_cache: key: 'npm-packages' paths: - /src/tools @@ -32,7 +32,7 @@ jobs: <<: *defaults steps: - checkout - restore_cache: + - restore_cache: key: - 'npm-packages' - npm_install From 604218df2d70ee3253391cc03d153ce57bc509a3 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede Date: Mon, 4 Jul 2022 13:30:07 +0100 Subject: [PATCH 07/11] config complete --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a52e20eee..fe0df9754 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,7 +44,7 @@ jobs: <<: *defaults steps: - checkout - restore_cache: + - restore_cache: key: - 'npm-packages' - npm_install From abc05721d2e100c7f10b0e557a61ae7648447aa3 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede Date: Mon, 4 Jul 2022 13:58:06 +0100 Subject: [PATCH 08/11] config complete --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe0df9754..b6e360da7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ jobs: steps: - checkout - restore_cache: - key: + keys: - 'npm-packages' - npm_install - run: @@ -45,7 +45,7 @@ jobs: steps: - checkout - restore_cache: - key: + keys: - 'npm-packages' - npm_install - run: From 154155cff6bc35f4752809937b6272274b9e28e1 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede Date: Mon, 4 Jul 2022 14:07:41 +0100 Subject: [PATCH 09/11] added fail check --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b6e360da7..76cc83b18 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,7 +50,11 @@ jobs: - npm_install - run: name: analyze - command: npm run audit + command: npm audit + - run: + name: Failed Tests + command: echo you failed bro + when: on_fail From b962b9eba4f9d2c7ce0482ce627d76b708328982 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede <106080091+NosakhareOsas@users.noreply.github.com> Date: Tue, 5 Jul 2022 12:20:33 +0100 Subject: [PATCH 10/11] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0df1cbc75..83f1beba9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@

+ +I added a circle-ci CI Pipeline with build, test and analyze jobs. --- [![Build status: Linux](https://img.shields.io/travis/coryhouse/react-slingshot.svg?style=flat-square)](https://travis-ci.org/coryhouse/react-slingshot) From a1d70aa48aa2bdc6e98dbedf79bd71f10e068bc5 Mon Sep 17 00:00:00 2001 From: Nosa Osagiede <106080091+NosakhareOsas@users.noreply.github.com> Date: Tue, 5 Jul 2022 12:33:24 +0100 Subject: [PATCH 11/11] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 83f1beba9..fcca3f96d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ +I added a circle-ci CI Pipeline with build, test and analyze jobs. +

-I added a circle-ci CI Pipeline with build, test and analyze jobs. + --- [![Build status: Linux](https://img.shields.io/travis/coryhouse/react-slingshot.svg?style=flat-square)](https://travis-ci.org/coryhouse/react-slingshot)