-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github CI config and project MakeFile
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |