Skip to content

Commit fbe7509

Browse files
authored
Merge pull request #1 from AndreuCodina/feature/add-changes
Add changes
2 parents 924dc90 + fd0663a commit fbe7509

File tree

8 files changed

+104
-37
lines changed

8 files changed

+104
-37
lines changed

.github/workflows/_deploy_api.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy API
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
environment:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-22.04
13+
environment: ${{ inputs.environment }}
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
20+
with:
21+
version: ${{ vars.UV_VERSION }}
22+
23+
- name: Install Python packages
24+
run: uv sync --locked --no-dev
25+
shell: bash
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy Transcriber
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
environment:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-22.04
13+
environment: ${{ inputs.environment }}
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
20+
with:
21+
version: ${{ vars.UV_VERSION }}
22+
23+
- name: Install Python packages
24+
run: uv sync --locked --no-dev
25+
shell: bash

.github/workflows/pull_request.yaml

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: false
1111

12-
env:
13-
UV_VERSION: "0.7.3"
14-
1512
jobs:
1613
continuous-integration:
1714
if: github.actor != 'dependabot[bot]'
@@ -25,7 +22,7 @@ jobs:
2522
- name: Install uv
2623
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
2724
with:
28-
version: ${{ env.UV_VERSION}}
25+
version: ${{ vars.UV_VERSION }}
2926

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

48-
- name: Integration tests
49-
run: uv run --frozen -- pytest -m integration
50-
shell: bash
45+
# - name: Integration tests
46+
# run: uv run --frozen -- pytest -m integration
47+
# shell: bash
5148

52-
release:
49+
deploy-api-dev:
5350
needs: continuous-integration
54-
runs-on: ubuntu-22.04
55-
steps:
56-
- name: Checkout repository
57-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
uses: ./.github/workflows/_deploy_api.yaml
52+
with:
53+
environment: dev
54+
secrets: inherit
5855

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

64-
- name: Install Python packages
65-
run: uv sync --locked --no-dev
66-
shell: bash
63+
deploy-api-stg:
64+
needs: [deploy-api-dev, deploy-transcriber-dev]
65+
uses: ./.github/workflows/_deploy_api.yaml
66+
with:
67+
environment: stg
68+
secrets: inherit
69+
70+
deploy-transcriber-stg:
71+
needs: [deploy-api-dev, deploy-transcriber-dev]
72+
uses: ./.github/workflows/_deploy_transcriber.yaml
73+
with:
74+
environment: stg
75+
secrets: inherit
76+
77+
deploy-api-pro:
78+
needs: [deploy-api-stg, deploy-transcriber-stg]
79+
uses: ./.github/workflows/_deploy_api.yaml
80+
with:
81+
environment: pro
82+
secrets: inherit
83+
84+
deploy-transcriber-pro:
85+
needs: [deploy-api-stg, deploy-transcriber-stg]
86+
uses: ./.github/workflows/_deploy_transcriber.yaml
87+
with:
88+
environment: pro
89+
secrets: inherit

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,18 @@
33
Python monorepo + uv + Vertical Slice Architecture
44

55
# Projects
6+
`api` and `transcriber`.
67

7-
## API
8-
9-
RESTful API.
8+
# Execute project
109

1110
```bash
12-
uv run -- fastapi dev api/src/api/main.py
11+
docker compose --file docker-compose-dev.yaml up --detach
1312
```
1413

1514
```bash
16-
docker build \
17-
--file api/src/api/Dockerfile \
18-
--tag python-monorepo:0.1.0 \
19-
--platform=linux/amd64 \
20-
.
15+
uv run -- fastapi dev api/src/api/main.py
2116
```
2217

2318
```bash
24-
docker run \
25-
--publish 8000:8000 \
26-
--env COMMON__ENVIRONMENT=Development \
27-
python-monorepo:0.1.0
19+
docker compose --file docker-compose-dev.yaml down --volumes
2820
```
29-
30-
# Transcriber
31-
32-
Audio transcriber reading from a queue.

domain/tests/__init__.py

Whitespace-only changes.

scripts/__init__.py

Whitespace-only changes.

scripts/script.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def main() -> None:
2+
print("Hello, World!") # noqa: T201
3+
4+
5+
if __name__ == "__main__":
6+
main()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class TranscriberPrinter:
22
def print(self) -> None:
3-
print("Transcriber printer")
3+
print("Transcriber printer") # noqa: T201

0 commit comments

Comments
 (0)