From bf23faaf9dd03331431265c0aec6ee82927d9f2c Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 17:51:37 -0400 Subject: [PATCH 01/26] Update ms5.yaml eric --- .github/workflows/ms5.yaml | 87 +++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 326c0ec..a550af1 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,64 +1,53 @@ -name: Pylint and API Testing - -on: +name: API CI/CD +# This is a trigger for any push to the repo, and tells github when the actions have to be run +# Every time we do a push, the action will be executed +# The actions should be run only when there is a push from main and develop +on: push: - branches: [Milestone-5_feature_branch] + branches: + - MileStone5eric +#Tells github actions what to execute when trigger condition is met jobs: - test-and-lint: - runs-on: self-hosted # or ubuntu-latest + # Each job runs in parallel + tests: #This is the job name + + # runs-on indicates which GitHub "Runners" will run this CICD pipeline + # For all CSE-2102 repos, just use the following line as is + runs-on: self-hosted + # This next block allows you to run this ENTIRE job on different python versions strategy: matrix: - python-version: ["3.10"] + #python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8"] + # Steps are run in sequence in this job. If one step fails, the entire job fails. steps: - #Checkout code - - uses: actions/checkout@v2 # Updated to correct version - - #Set up Python + # Use this next line to pull your repo into the Docker container running the job + - uses: actions/checkout@v3 + # This block sets up the python version - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - #Install everything - - name: Install dependencies + # Pylint is a static code analysis tool. Use this block as is to install pylint + # in the Docker container running the job + - name: Install pylint run: | python -m pip install --upgrade pip - pip install pylint flask flask_cors flasgger pytest - - #Run pylint on all Python files - - name: Analyze code with pylint, excluding main.py + pip install pylint + # Run pylint on your pulled code in the Docker container running the job + - name: Analysing the code with pylint run: | - pylint $(git ls-files '*.py') - - #Build Docker Image for API - - name: Build API Docker Image + pylint $(git ls-files 'hw002/*.py') + # Pytest is for unit testing your python code. Use this block as is to + # install pytest in the Docker container running the job + - name: Install pytest run: | - docker build -t api-image -f Backend/dockerfile . - - - # Stop and Remove Existing Container (if any). this was the error - - name: Stop and Remove Existing API Container - run: | - docker stop api-container || true # Stop if running, ignore if not - sleep 10 - docker rm api-container || true # Remove if exists, ignore if not - sleep 1 - - #Start API Container - - name: Start API Container - run: | - docker run -d -p 5000:5000 --name api-container --memory=7g api-image # Start container on port 5000 - - #Run all Python tests in the directory - - name: Run the Python tests in directory - run: | - docker exec api-container python3 main.py # Execute main.py - #docker exec api-container pytest test_main.py # Execute test_main.py - - #Stop and Remove API Container after tests - - name: Stop and Remove API Container + python -m pip install --upgrade pip + pip install pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + # Run pytest on your pulled codebase + - name: Test with pytest run: | - docker stop api-container # Stop container after tests - docker rm api-container # Remove container after tests + pytest From 790c0d93c00a9f715d267b60b63d48ad8dc7da1b Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 17:52:59 -0400 Subject: [PATCH 02/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index a550af1..aa4840c 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -36,10 +36,8 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - # Run pylint on your pulled code in the Docker container running the job - - name: Analysing the code with pylint - run: | - pylint $(git ls-files 'hw002/*.py') + + # Pytest is for unit testing your python code. Use this block as is to # install pytest in the Docker container running the job - name: Install pytest From a7576bff7f10d5cc3c396b98f7451dae62ba099c Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:00:42 -0400 Subject: [PATCH 03/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index aa4840c..b6ba8f7 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -36,7 +36,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - + # Pytest is for unit testing your python code. Use this block as is to # install pytest in the Docker container running the job @@ -45,6 +45,12 @@ jobs: python -m pip install --upgrade pip pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Build and Run Docker + run: | + docker build -f dockerfile -t doc . + docker run -d -p 5000:5000 doc + # Run pytest on your pulled codebase - name: Test with pytest run: | From 81ff191e052379fd00ac8eb55e35054bfd0be217 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:03:00 -0400 Subject: [PATCH 04/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index b6ba8f7..b915b02 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -48,7 +48,7 @@ jobs: - name: Build and Run Docker run: | - docker build -f dockerfile -t doc . + docker build -f Backend/Docker -t doc . docker run -d -p 5000:5000 doc # Run pytest on your pulled codebase From 4531d69dbd671adefb9897f9b8b403336b1294b0 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:08:45 -0400 Subject: [PATCH 05/26] Update Docker From a0269728cf8e2a1c8edb8194c0484662ff91bec3 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:13:17 -0400 Subject: [PATCH 06/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index b915b02..52e6d67 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -48,7 +48,7 @@ jobs: - name: Build and Run Docker run: | - docker build -f Backend/Docker -t doc . + docker build -f Backend/Docker -t doc cse2102-fall24-Team51/Backend/ docker run -d -p 5000:5000 doc # Run pytest on your pulled codebase From 0a6302ad089cc067247b86f44863e9b419c53a34 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:14:07 -0400 Subject: [PATCH 07/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 52e6d67..4f77eda 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -48,7 +48,7 @@ jobs: - name: Build and Run Docker run: | - docker build -f Backend/Docker -t doc cse2102-fall24-Team51/Backend/ + docker build -f Backend/Docker -t doc Backend/ docker run -d -p 5000:5000 doc # Run pytest on your pulled codebase From 8ab60fb513458f57a75dca43e0a962c93c28f4e8 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:17:15 -0400 Subject: [PATCH 08/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 4f77eda..f254fc0 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -46,9 +46,12 @@ jobs: pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Build and Run Docker + - name: Build Docker run: | docker build -f Backend/Docker -t doc Backend/ + + - name: Run Docker + run: | docker run -d -p 5000:5000 doc # Run pytest on your pulled codebase From 9c2a83331eee8e1135e5ed6d3514ad6cdd14d3a3 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:19:43 -0400 Subject: [PATCH 09/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index f254fc0..4ac0781 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -46,6 +46,14 @@ jobs: pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Stop Docker + run: | + docker stop $(docker ps -q) + + - name: Remove Docker + run: | + docker rm $(docker ps -a -q) + - name: Build Docker run: | docker build -f Backend/Docker -t doc Backend/ From b6b002eb9eb6e793056c8a3a07b3f62adfb7677c Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:34:55 -0400 Subject: [PATCH 10/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 39 ++++++++------------------------------ 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 4ac0781..9391f05 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,16 +1,14 @@ -name: API CI/CD -# This is a trigger for any push to the repo, and tells github when the actions have to be run -# Every time we do a push, the action will be executed -# The actions should be run only when there is a push from main and develop -on: +name: API CI/CD + +# This is a trigger for any push to the repo +on: push: branches: - MileStone5eric -#Tells github actions what to execute when trigger condition is met jobs: # Each job runs in parallel - tests: #This is the job name + name_your_job_whatever_you_want: # runs-on indicates which GitHub "Runners" will run this CICD pipeline # For all CSE-2102 repos, just use the following line as is @@ -32,36 +30,15 @@ jobs: python-version: ${{ matrix.python-version }} # Pylint is a static code analysis tool. Use this block as is to install pylint # in the Docker container running the job - - name: Install pylint - run: | - python -m pip install --upgrade pip - pip install pylint - - + + # Pytest is for unit testing your python code. Use this block as is to # install pytest in the Docker container running the job - name: Install pytest run: | python -m pip install --upgrade pip pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Stop Docker - run: | - docker stop $(docker ps -q) - - - name: Remove Docker - run: | - docker rm $(docker ps -a -q) - - - name: Build Docker - run: | - docker build -f Backend/Docker -t doc Backend/ - - - name: Run Docker - run: | - docker run -d -p 5000:5000 doc - + if [ -f ./Backend/requirements.txt ]; then pip install -r ./Backend/requirements.txt; fi # Run pytest on your pulled codebase - name: Test with pytest run: | From 6e834250f679f35d915ffb3cf2b9b635e401a969 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:41:38 -0400 Subject: [PATCH 11/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 9391f05..9c31d29 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,22 +1,21 @@ -name: API CI/CD - -# This is a trigger for any push to the repo -on: +name: API CI/CD +# This is a trigger for any push to the repo, and tells github when the actions have to be run +# Every time we do a push, the action will be executed +# The actions should be run only when there is a push from main and develop +on: push: branches: - MileStone5eric +#Tells github actions what to execute when trigger condition is met jobs: - # Each job runs in parallel - name_your_job_whatever_you_want: - # runs-on indicates which GitHub "Runners" will run this CICD pipeline - # For all CSE-2102 repos, just use the following line as is + tests: #This is the job name runs-on: self-hosted - # This next block allows you to run this ENTIRE job on different python versions + strategy: matrix: - #python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8"] # Steps are run in sequence in this job. If one step fails, the entire job fails. @@ -30,15 +29,21 @@ jobs: python-version: ${{ matrix.python-version }} # Pylint is a static code analysis tool. Use this block as is to install pylint # in the Docker container running the job - - + - name: Install pylint + run: | + python -m pip install --upgrade pip + pip install pylint + + # Pytest is for unit testing your python code. Use this block as is to # install pytest in the Docker container running the job - name: Install pytest run: | python -m pip install --upgrade pip pip install pytest - if [ -f ./Backend/requirements.txt ]; then pip install -r ./Backend/requirements.txt; fi + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + # Run pytest on your pulled codebase - name: Test with pytest run: | From 91f79c959ac30b42cdf44ee99f06dec9b5c799cf Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:45:45 -0400 Subject: [PATCH 12/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 9c31d29..bcf6bb3 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,21 +1,22 @@ -name: API CI/CD -# This is a trigger for any push to the repo, and tells github when the actions have to be run -# Every time we do a push, the action will be executed -# The actions should be run only when there is a push from main and develop -on: +name: CI Pipeline + +# This is a trigger for any push to the repo +on: push: branches: - MileStone5eric -#Tells github actions what to execute when trigger condition is met jobs: + # Each job runs in parallel + name_your_job_whatever_you_want: - tests: #This is the job name + # runs-on indicates which GitHub "Runners" will run this CICD pipeline + # For all CSE-2102 repos, just use the following line as is runs-on: self-hosted - + # This next block allows you to run this ENTIRE job on different python versions strategy: matrix: - + #python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] python-version: ["3.8"] # Steps are run in sequence in this job. If one step fails, the entire job fails. @@ -33,17 +34,17 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - - + # Run pylint on your pulled code in the Docker container running the job + - name: Analysing the code with pylint + run: | + pylint $(git ls-files './backend/*.py') # Pytest is for unit testing your python code. Use this block as is to # install pytest in the Docker container running the job - name: Install pytest run: | python -m pip install --upgrade pip pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - + # Run pytest on your pulled codebase - name: Test with pytest run: | From 352af6fbb5e5917848965bbb0491f9ffc97a4f5c Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:50:51 -0400 Subject: [PATCH 13/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index bcf6bb3..1e43ac4 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,14 +1,16 @@ -name: CI Pipeline - -# This is a trigger for any push to the repo -on: +name: API CI/CD +# This is a trigger for any push to the repo, and tells github when the actions have to be run +# Every time we do a push, the action will be executed +# The actions should be run only when there is a push from main and develop +on: push: branches: - MileStone5eric +#Tells github actions what to execute when trigger condition is met jobs: # Each job runs in parallel - name_your_job_whatever_you_want: + tests: #This is the job name # runs-on indicates which GitHub "Runners" will run this CICD pipeline # For all CSE-2102 repos, just use the following line as is @@ -34,18 +36,20 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - # Run pylint on your pulled code in the Docker container running the job - - name: Analysing the code with pylint - run: | - pylint $(git ls-files './backend/*.py') + + # Pytest is for unit testing your python code. Use this block as is to # install pytest in the Docker container running the job - name: Install pytest run: | python -m pip install --upgrade pip pip install pytest - + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Run main.py + run: | + python3 Backend/main.py + # Run pytest on your pulled codebase - name: Test with pytest run: | - pytest + Backend/ pytest From 2daea5ff433690a5d3992f4e9fea78f480346d72 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:53:01 -0400 Subject: [PATCH 14/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 1e43ac4..b458826 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -45,11 +45,9 @@ jobs: python -m pip install --upgrade pip pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Run main.py - run: | - python3 Backend/main.py + # Run pytest on your pulled codebase - name: Test with pytest run: | - Backend/ pytest + pytest From 7e869ac385254c78eee8637ec7a039368addb8b9 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Sat, 2 Nov 2024 06:16:26 -0400 Subject: [PATCH 15/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index b458826..ad2e623 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -46,8 +46,4 @@ jobs: pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - # Run pytest on your pulled codebase - - name: Test with pytest - run: | - pytest + From 5975b638c52b7067e746432a260118fa212b01c5 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Sat, 2 Nov 2024 06:20:43 -0400 Subject: [PATCH 16/26] n.yaml --- .github/workflows/ms5.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index ad2e623..b915b02 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -46,4 +46,12 @@ jobs: pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - + - name: Build and Run Docker + run: | + docker build -f Backend/Docker -t doc . + docker run -d -p 5000:5000 doc + + # Run pytest on your pulled codebase + - name: Test with pytest + run: | + pytest From c820265aecef9adfdf22040e810eb59bc9bd9696 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Sat, 2 Nov 2024 06:24:25 -0400 Subject: [PATCH 17/26] nn.yaml --- .github/workflows/ms5.yaml | 56 ++++---------------------------------- 1 file changed, 6 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index b915b02..e4fc9d7 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,57 +1,13 @@ -name: API CI/CD -# This is a trigger for any push to the repo, and tells github when the actions have to be run -# Every time we do a push, the action will be executed -# The actions should be run only when there is a push from main and develop +name: Simple CI/CD Pipeline + on: push: branches: - MileStone5eric -#Tells github actions what to execute when trigger condition is met jobs: - # Each job runs in parallel - tests: #This is the job name - - # runs-on indicates which GitHub "Runners" will run this CICD pipeline - # For all CSE-2102 repos, just use the following line as is - runs-on: self-hosted - # This next block allows you to run this ENTIRE job on different python versions - strategy: - matrix: - #python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - python-version: ["3.8"] - - # Steps are run in sequence in this job. If one step fails, the entire job fails. + do-nothing: + runs-on: ubuntu-latest steps: - # Use this next line to pull your repo into the Docker container running the job - - uses: actions/checkout@v3 - # This block sets up the python version - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - # Pylint is a static code analysis tool. Use this block as is to install pylint - # in the Docker container running the job - - name: Install pylint - run: | - python -m pip install --upgrade pip - pip install pylint - - - # Pytest is for unit testing your python code. Use this block as is to - # install pytest in the Docker container running the job - - name: Install pytest - run: | - python -m pip install --upgrade pip - pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Build and Run Docker - run: | - docker build -f Backend/Docker -t doc . - docker run -d -p 5000:5000 doc - - # Run pytest on your pulled codebase - - name: Test with pytest - run: | - pytest + - name: Do nothing + run: echo "This is a simple CI/CD pipeline that does nothing." From 3ceb7ee1ebdbb5b2444917a5448befdf65ed9326 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Sat, 2 Nov 2024 06:27:03 -0400 Subject: [PATCH 18/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index e4fc9d7..e12bbae 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -7,7 +7,7 @@ on: jobs: do-nothing: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Do nothing run: echo "This is a simple CI/CD pipeline that does nothing." From 312a94d3d18e856f6e12a3424eb10e619c2e0860 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Sat, 2 Nov 2024 18:25:34 -0400 Subject: [PATCH 19/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index e12bbae..3fb8f72 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -10,4 +10,4 @@ jobs: runs-on: self-hosted steps: - name: Do nothing - run: echo "This is a simple CI/CD pipeline that does nothing." + run: echo "This is a simple CI/CDk pipeline that does nothing." From 0c7a00a3380b781db408f934d79c92a7273faf8a Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Sat, 2 Nov 2024 18:26:43 -0400 Subject: [PATCH 20/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 50 ++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 3fb8f72..a550af1 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,13 +1,53 @@ -name: Simple CI/CD Pipeline - +name: API CI/CD +# This is a trigger for any push to the repo, and tells github when the actions have to be run +# Every time we do a push, the action will be executed +# The actions should be run only when there is a push from main and develop on: push: branches: - MileStone5eric +#Tells github actions what to execute when trigger condition is met jobs: - do-nothing: + # Each job runs in parallel + tests: #This is the job name + + # runs-on indicates which GitHub "Runners" will run this CICD pipeline + # For all CSE-2102 repos, just use the following line as is runs-on: self-hosted + # This next block allows you to run this ENTIRE job on different python versions + strategy: + matrix: + #python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8"] + + # Steps are run in sequence in this job. If one step fails, the entire job fails. steps: - - name: Do nothing - run: echo "This is a simple CI/CDk pipeline that does nothing." + # Use this next line to pull your repo into the Docker container running the job + - uses: actions/checkout@v3 + # This block sets up the python version + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + # Pylint is a static code analysis tool. Use this block as is to install pylint + # in the Docker container running the job + - name: Install pylint + run: | + python -m pip install --upgrade pip + pip install pylint + # Run pylint on your pulled code in the Docker container running the job + - name: Analysing the code with pylint + run: | + pylint $(git ls-files 'hw002/*.py') + # Pytest is for unit testing your python code. Use this block as is to + # install pytest in the Docker container running the job + - name: Install pytest + run: | + python -m pip install --upgrade pip + pip install pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + # Run pytest on your pulled codebase + - name: Test with pytest + run: | + pytest From 38c7d37e02a9ca7e54beff6b9be906bdd9e7365b Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Mon, 4 Nov 2024 10:30:19 -0500 Subject: [PATCH 21/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index a550af1..ce7aabd 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -36,18 +36,3 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - # Run pylint on your pulled code in the Docker container running the job - - name: Analysing the code with pylint - run: | - pylint $(git ls-files 'hw002/*.py') - # Pytest is for unit testing your python code. Use this block as is to - # install pytest in the Docker container running the job - - name: Install pytest - run: | - python -m pip install --upgrade pip - pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - # Run pytest on your pulled codebase - - name: Test with pytest - run: | - pytest From 8c651c7af3a27e6f296ed452bf393278cfa69043 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Mon, 4 Nov 2024 10:32:38 -0500 Subject: [PATCH 22/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index ce7aabd..658f6e4 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -36,3 +36,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint + + - name: RUN Api + run: | + python3 Backend/main.py From 0005c6f8b0f18b458554f8544afadd646109000a Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Mon, 4 Nov 2024 10:38:36 -0500 Subject: [PATCH 23/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 658f6e4..2e53981 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -37,6 +37,8 @@ jobs: python -m pip install --upgrade pip pip install pylint - - name: RUN Api + - name: Install pytest run: | - python3 Backend/main.py + python -m pip install --upgrade pip + pip install pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi From fda943e158d21f787865fcf37e9e5f9d90b6959c Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Mon, 4 Nov 2024 11:26:03 -0500 Subject: [PATCH 24/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 2e53981..9458f15 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -42,3 +42,13 @@ jobs: python -m pip install --upgrade pip pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Run Api + run: | + python3 main.py + + + - name: pytest + run: | + pytest + From a1e1b51a5c2398bc28e3a00577c7116a3e1c6d09 Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Mon, 4 Nov 2024 11:27:38 -0500 Subject: [PATCH 25/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 9458f15..7f610f1 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -45,7 +45,7 @@ jobs: - name: Run Api run: | - python3 main.py + python3 Backend/main.py - name: pytest From b6942feae8058c86fe034782d66ea3b73a0f277d Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Mon, 4 Nov 2024 11:31:40 -0500 Subject: [PATCH 26/26] Update ms5.yaml --- .github/workflows/ms5.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 7f610f1..17c8e23 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -45,7 +45,7 @@ jobs: - name: Run Api run: | - python3 Backend/main.py + python3 Backend/main.py & - name: pytest