-
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.
- Loading branch information
Showing
3 changed files
with
144 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,39 @@ | ||
Reviewer: | ||
Estimate: | ||
|
||
--- | ||
|
||
## Ticket | ||
|
||
Fixes: JIRA_TICKET_LINK | ||
|
||
## Description | ||
|
||
### Goal | ||
|
||
### Changes | ||
|
||
### Future Tasks (optional) | ||
|
||
## How has this been tested? | ||
|
||
## To-do before merge (optional) | ||
|
||
## Checklist | ||
|
||
Fill with `x` for completed. | ||
|
||
- [ ] My code follows the style guidelines of this project | ||
- [ ] I have reviewed my own code to ensure good quality | ||
- [ ] I have tested the functionality of my code to ensure it works as intended | ||
- [ ] I have resolved merge conflicts | ||
|
||
(Delete any items below that are not relevant) | ||
- [ ] I have updated the automated tests | ||
- [ ] I have updated the scripts in `scripts/` | ||
- [ ] I have updated the requirements | ||
- [ ] I have updated the README file | ||
- [ ] I have updated affected documentation | ||
- [ ] I have added a blogpost in Latest Updates | ||
- [ ] I have updated the CI/CD scripts in `.github/workflows/` | ||
- [ ] I have updated the Terraform code |
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,42 @@ | ||
name: Python Linting | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "**" | ||
paths: | ||
- "**.py" | ||
|
||
jobs: | ||
python-lint-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
cache: "pip" | ||
cache-dependency-path: | | ||
backend/requirements.txt | ||
requirements-dev.txt | ||
- run: | | ||
python -m pip install --upgrade pip | ||
pip install -r backend/requirements.txt | ||
pip install -r requirements-dev.txt | ||
- name: Run MyPy | ||
run: | | ||
mypy backend/app | ||
- name: Run ruff | ||
run: | | ||
ruff check --exclude "backend/migrations" . | ||
- name: Check code formatting with Black | ||
run: | | ||
cd backend | ||
black --check . |
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,63 @@ | ||
name: Unit Tests | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "**" | ||
paths: | ||
- "**.py" | ||
- ".github/workflows/tests.yaml" | ||
env: | ||
POSTGRES_PASSWORD: postgres-test-pw | ||
POSTGRES_USER: postgres-test-user | ||
POSTGRES_DB: postgres-test-db | ||
REDIS_HOST: redis://redis:6379 | ||
jobs: | ||
container-job: | ||
runs-on: ubuntu-20.04 | ||
container: node:20.7-bullseye | ||
services: | ||
postgres: | ||
image: postgres:16.4 | ||
env: | ||
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | ||
POSTGRES_USER: ${{ env.POSTGRES_USER }} | ||
POSTGRES_DB: ${{ env.POSTGRES_DB }} | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 5s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
redis: | ||
image: redis:6.0-alpine | ||
options: >- | ||
--health-cmd "redis-cli ping || exit 1" | ||
--health-interval 5s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 6379:6379 | ||
steps: | ||
- name: install dependencies | ||
run: apt-get update && apt-get install -y lsb-release && apt-get clean all | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
- name: Install Python libraries | ||
run: | | ||
python -m pip install -r backend/requirements.txt | ||
python -m pip install -r requirements-dev.txt | ||
- name: Run Unit Tests | ||
env: | ||
PROMETHEUS_MULTIPROC_DIR: /tmp | ||
REDIS_HOST: ${{ env.REDIS_HOST }} | ||
run: | | ||
cd backend | ||
export POSTGRES_HOST=postgres POSTGRES_USER=$POSTGRES_USER \ | ||
POSTGRES_PASSWORD=$POSTGRES_PASSWORD POSTGRES_DB=$POSTGRES_DB \ | ||
python -m alembic upgrade head | ||
python -m pytest -m "not slow" tests |