From 6de2f6d250c6dbc789e3f104afdd873cfbbf2906 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 17:57:56 +0000 Subject: [PATCH] submmit --- .circleci/config.yml | 60 ++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4175da6cf..4d9f9448c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,26 +1,48 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference version: 2.1 -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/configuration-reference/#jobs jobs: - say-hello: - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/configuration-reference/#executor-job + build: docker: - - image: cimg/base:stable - # Add steps to the job - # See: https://circleci.com/docs/configuration-reference/#steps + - image: circleci/python:3.7.3-stretch + + working_directory: ~/repo + steps: - checkout - - run: - name: "Say hello" - command: "echo Hello, World!" -# Orchestrate jobs using workflows -# See: https://circleci.com/docs/configuration-reference/#workflows -workflows: - say-hello-workflow: - jobs: - - say-hello + # Set up Docker environment + - setup_remote_docker + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "requirements.txt" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: install dependencies + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + python3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + - save_cache: + paths: + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }} + + # run tests! + - run: + name: run tests + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + . venv/bin/activate + make test + # run lints! + - run: + name: run lint + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + . venv/bin/activate + make lint