Skip to content

Commit

Permalink
added github actions for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bensialih committed Jul 20, 2024
1 parent 32a64cc commit f7ded87
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/python_lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: algeria-cities python lib

on: [push]

jobs:
ci:
run-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: action/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
uses: abatilo/actions-poetry@v2

- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install the project dependencies
run: poetry install

- name: Run unittests
working-directory: ./python
run: poetry run pytest tests -s
3 changes: 3 additions & 0 deletions python/poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[virtualenvs]
create = true
in-project = true
3 changes: 0 additions & 3 deletions python/src/algeria_cities/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@

def main():
print("hello world")

0 comments on commit f7ded87

Please sign in to comment.