Skip to content

Commit

Permalink
had an issue with the yaml hopefully this works better
Browse files Browse the repository at this point in the history
  • Loading branch information
kek20009 committed Oct 31, 2024
1 parent 8cc9deb commit 70379a1
Showing 1 changed file with 40 additions and 41 deletions.
81 changes: 40 additions & 41 deletions .github/workflows/ms5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,43 @@ jobs:
python-version: ["3.8", "3.9", "3.10"]

steps:

uses: actions/checkout@v2 # Updated to correct version

#Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

#Install everything
- name: Install dependencies
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
run: |
pylint $(git ls-files '*.py')
#Build Docker Image for API
- name: Build API Docker Image
run: |
docker build -t api-image -f ./docker/dockerfile .
#tart Container
- name: Start API Container
run: |
docker run -d -p 5000:5000 --name api-container api-image
#Start the API Service & Run All Tests
- name: Run all Python tests in directory
run: |
docker exec api-container pytest $(find . -name 'test_*.py')
#End the testing
- name: Stop and Remove API Container
run: |
docker stop api-container
docker rm api-container
# Checkout code
- uses: actions/checkout@v2 # Updated to correct version

#Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

#Install everything
- name: Install dependencies
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
run: |
pylint $(git ls-files '*.py')
#Build Docker Image for API
- name: Build API Docker Image
run: |
docker build -t api-image -f ./docker/dockerfile .
#Start Container
- name: Start API Container
run: |
docker run -d -p 5000:5000 --name api-container api-image
#Start the API Service & Run All Tests
- name: Run all Python tests in directory
run: |
docker exec api-container pytest $(find . -name 'test_*.py')
#End the testing
- name: Stop and Remove API Container
run: |
docker stop api-container
docker rm api-container

0 comments on commit 70379a1

Please sign in to comment.