diff --git a/.github/workflows/pre-commit-and-tests.yml b/.github/workflows/pre-commit-and-tests.yml new file mode 100644 index 0000000..1e7180d --- /dev/null +++ b/.github/workflows/pre-commit-and-tests.yml @@ -0,0 +1,39 @@ +name: pre-commit and tests + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Run pre-commit + uses: pre-commit/action@v3.0.0 + + tests: + needs: pre-commit + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pipenv + pipenv install --dev --system + + - name: Run tests + run: | + pytest diff --git a/README.md b/README.md index 1d90ec1..1452707 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# gamification_api \ No newline at end of file +# gamification_api diff --git a/repository_interface/global_results_respository.py b/repository_interface/global_results_respository.py index 9a063f5..6f7505a 100644 --- a/repository_interface/global_results_respository.py +++ b/repository_interface/global_results_respository.py @@ -2,6 +2,5 @@ class GlobalResultsRepository(Protocol): - def get(): ... diff --git a/sql_alchemy_repository/global_results_repository_sql_alchemy.py b/sql_alchemy_repository/global_results_repository_sql_alchemy.py index 2ac020c..17ea3e2 100644 --- a/sql_alchemy_repository/global_results_repository_sql_alchemy.py +++ b/sql_alchemy_repository/global_results_repository_sql_alchemy.py @@ -2,6 +2,7 @@ class GlobalResultsSQLAlchemy: """ This is a mock. Here we should make a query """ + def get(self): return { "data": {