Skip to content

Update workflow.yml

Update workflow.yml #3

Workflow file for this run

name: CI workflow
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
container: python:3.9-slim
steps:
# Step 1: Checkout the repository
- name: Checkout
uses: actions/checkout@v3
# Step 2: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8
pip install nose
# Step 3: Lint the code with flake8
- name: Lint with flake8
run: |
# Lint the service code
flake8 ci_cd_final_project/service --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ci_cd_final_project/service --count --max-complexity=10 --max-line-length=127 --statistics
# Lint the tests folder
flake8 ci_cd_final_project/tests --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ci_cd_final_project/tests --count --max-complexity=10 --max-line-length=127 --statistics
# Step 4: Run unit tests with nose
- name: Run unit tests with nose
run: |
nosetests -v --with-spec --spec-color --with-coverage --cover-package=ci_cd_final_project/service