Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI (test)

on:
push:
branches:
- main
pull_request:
branches:
- main


jobs:
test:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

runs-on: ubuntu-latest

defaults:
run:
working-directory: 01-ci-lab

steps:

- name: Checkout repository
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run test
run: pytest

- name: Run linter
run: flake8 .
3 changes: 2 additions & 1 deletion 01-ci-lab/app/calculator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
def add(a, b):
return a + b


def divide(a, b):
return a / b
return a / b
4 changes: 3 additions & 1 deletion 01-ci-lab/tests/test_calculator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from app.calculator import add, divide


def test_add():
assert add(2, 3) == 5


def test_divide():
assert divide(10, 2) == 5
assert divide(10, 2) == 5
Loading