Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/_deploy_api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy API

on:
workflow_call:
inputs:
environment:
required: true
type: string

jobs:
deploy:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
version: ${{ vars.UV_VERSION }}

- name: Install Python packages
run: uv sync --locked --no-dev
shell: bash
25 changes: 25 additions & 0 deletions .github/workflows/_deploy_transcriber.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Transcriber

on:
workflow_call:
inputs:
environment:
required: true
type: string

jobs:
deploy:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
version: ${{ vars.UV_VERSION }}

- name: Install Python packages
run: uv sync --locked --no-dev
shell: bash
61 changes: 42 additions & 19 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

env:
UV_VERSION: "0.7.3"

jobs:
continuous-integration:
if: github.actor != 'dependabot[bot]'
Expand All @@ -25,7 +22,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
version: ${{ env.UV_VERSION}}
version: ${{ vars.UV_VERSION }}

- name: Install Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
Expand All @@ -45,22 +42,48 @@ jobs:
run: uv run --frozen -- pytest -m unit
shell: bash

- name: Integration tests
run: uv run --frozen -- pytest -m integration
shell: bash
# - name: Integration tests
# run: uv run --frozen -- pytest -m integration
# shell: bash

release:
deploy-api-dev:
needs: continuous-integration
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: ./.github/workflows/_deploy_api.yaml
with:
environment: dev
secrets: inherit

- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
version: ${{ env.UV_VERSION}}
deploy-transcriber-dev:
needs: continuous-integration
uses: ./.github/workflows/_deploy_transcriber.yaml
with:
environment: dev
secrets: inherit

- name: Install Python packages
run: uv sync --locked --no-dev
shell: bash
deploy-api-stg:
needs: [deploy-api-dev, deploy-transcriber-dev]
uses: ./.github/workflows/_deploy_api.yaml
with:
environment: stg
secrets: inherit

deploy-transcriber-stg:
needs: [deploy-api-dev, deploy-transcriber-dev]
uses: ./.github/workflows/_deploy_transcriber.yaml
with:
environment: stg
secrets: inherit

deploy-api-pro:
needs: [deploy-api-stg, deploy-transcriber-stg]
uses: ./.github/workflows/_deploy_api.yaml
with:
environment: pro
secrets: inherit

deploy-transcriber-pro:
needs: [deploy-api-stg, deploy-transcriber-stg]
uses: ./.github/workflows/_deploy_transcriber.yaml
with:
environment: pro
secrets: inherit
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,18 @@
Python monorepo + uv + Vertical Slice Architecture

# Projects
`api` and `transcriber`.

## API

RESTful API.
# Execute project

```bash
uv run -- fastapi dev api/src/api/main.py
docker compose --file docker-compose-dev.yaml up --detach
```

```bash
docker build \
--file api/src/api/Dockerfile \
--tag python-monorepo:0.1.0 \
--platform=linux/amd64 \
.
uv run -- fastapi dev api/src/api/main.py
```

```bash
docker run \
--publish 8000:8000 \
--env COMMON__ENVIRONMENT=Development \
python-monorepo:0.1.0
docker compose --file docker-compose-dev.yaml down --volumes
```

# Transcriber

Audio transcriber reading from a queue.
Empty file added domain/tests/__init__.py
Empty file.
Empty file added scripts/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions scripts/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def main() -> None:
print("Hello, World!") # noqa: T201


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion transcriber/src/transcriber/transcriber_printer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class TranscriberPrinter:
def print(self) -> None:
print("Transcriber printer")
print("Transcriber printer") # noqa: T201