Skip to content

Commit

Permalink
Add github CI config and project MakeFile
Browse files Browse the repository at this point in the history
  • Loading branch information
erdem committed Aug 16, 2024
1 parent 94c93eb commit 4ff528f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

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

jobs:
linter:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run isort
run: make isort
env:
POETRY_VIRTUALENVS_IN_PROJECT: true

- name: Run black
run: make black
env:
POETRY_VIRTUALENVS_IN_PROJECT: true

tests:
runs-on: ubuntu-latest
needs: linter

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run tests
run: make run_tests
env:
POETRY_VIRTUALENVS_IN_PROJECT: true
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
install:
poetry install --no-root

dev:
poetry run fastapi dev src/main.py

test:
poetry run python src/tests.py

black:
poetry run black .

isort:
poetry run isort .

run_tests:
poetry run pytest .

.PHONY: install dev

0 comments on commit 4ff528f

Please sign in to comment.