Skip to content

Commit e3bb552

Browse files
authored
Update workflow.yml
1 parent 89e4ca7 commit e3bb552

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/workflow.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI workflow
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
container: python:3.9-slim
13+
14+
steps:
15+
# Step 1: Checkout the repository
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
# Step 2: Install dependencies
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -r requirements.txt
24+
pip install flake8
25+
pip install nose
26+
27+
# Step 3: Lint the code with flake8
28+
- name: Lint with flake8
29+
run: |
30+
flake8 ci_cd_final_project/service --count --select=E9,F63,F7,F82 --show-source --statistics
31+
flake8 ci_cd_final_project/service --count --max-complexity=10 --max-line-length=127 --statistics
32+
flake8 ci_cd_final_project/tests --count --select=E9,F63,F7,F82 --show-source --statistics
33+
flake8 ci_cd_final_project/tests --count --max-complexity=10 --max-line-length=127 --statistics
34+
35+
# Step 4: Run unit tests with nose
36+
- name: Run unit tests with nose
37+
run: |
38+
nosetests -v --with-spec --spec-color --with-coverage --cover-package=ci_cd_final_project/service

0 commit comments

Comments
 (0)