Skip to content

Commit 6d59f80

Browse files
authored
Merge branch 'master' into encryption-algorithm
2 parents 6b4dcea + 3793150 commit 6d59f80

23 files changed

+1805
-2357
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
version: 2
22
updates:
33
# GitHub Actions
4-
- package-ecosystem: "github-actions"
5-
directory: "/"
4+
- package-ecosystem: github-actions
5+
directory: /
66
schedule:
7-
interval: "daily"
7+
interval: daily
88
commit-message:
99
prefix:
1010
# Python
11-
- package-ecosystem: "pip"
12-
directory: "/"
11+
- package-ecosystem: pip
12+
directory: /
1313
schedule:
14-
interval: "daily"
14+
interval: daily
1515
commit-message:
1616
prefix:

.github/workflows/generate-client.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ jobs:
1212
contents: write
1313
runs-on: ubuntu-latest
1414
steps:
15+
# For PRs from forks
1516
- uses: actions/checkout@v4
17+
# For PRs from the same repo
18+
- uses: actions/checkout@v4
19+
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
1620
with:
1721
ref: ${{ github.head_ref }}
1822
token: ${{ secrets.FULL_STACK_FASTAPI_TEMPLATE_REPO_TOKEN }}
@@ -21,29 +25,33 @@ jobs:
2125
node-version: lts/*
2226
- uses: actions/setup-python@v5
2327
with:
24-
python-version: '3.10'
28+
python-version: "3.10"
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v2
31+
with:
32+
version: "0.4.15"
33+
enable-cache: true
2534
- name: Install dependencies
2635
run: npm ci
2736
working-directory: frontend
28-
- run: pip install ./backend
29-
- run: bash scripts/generate-client.sh
30-
- name: Commit changes
37+
- run: uv sync
38+
working-directory: backend
39+
- run: uv run bash scripts/generate-client.sh
40+
env:
41+
VIRTUAL_ENV: backend/.venv
42+
- name: Add changes to git
3143
run: |
3244
git config --local user.email "[email protected]"
3345
git config --local user.name "github-actions"
3446
git add frontend/src/client
47+
# Same repo PRs
48+
- name: Push changes
49+
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
50+
run: |
3551
git diff --staged --quiet || git commit -m "✨ Autogenerate frontend client"
3652
git push
37-
38-
# https://github.com/marketplace/actions/alls-green#why
39-
generate-client-alls-green: # This job does nothing and is only used for the branch protection
40-
if: always()
41-
needs:
42-
- generate-client
43-
runs-on: ubuntu-latest
44-
steps:
45-
- name: Decide whether the needed jobs succeeded or failed
46-
uses: re-actors/alls-green@release/v1
47-
with:
48-
jobs: ${{ toJSON(needs) }}
49-
53+
# Fork PRs
54+
- name: Check changes
55+
if: ( github.event_name == 'pull_request' && github.secret_source != 'Actions' )
56+
run: |
57+
git diff --staged --quiet || (echo "Changes detected in generated client, run scripts/generate-client.sh and commit the changes" && exit 1)

.github/workflows/issue-manager.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
env:
2828
GITHUB_CONTEXT: ${{ toJson(github) }}
2929
run: echo "$GITHUB_CONTEXT"
30-
- uses: tiangolo/[email protected].0
30+
- uses: tiangolo/[email protected].1
3131
with:
3232
token: ${{ secrets.GITHUB_TOKEN }}
3333
config: >

.github/workflows/latest-changes.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ on:
1212
description: PR number
1313
required: true
1414
debug_enabled:
15-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
15+
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
1616
required: false
17-
default: 'false'
17+
default: "false"
1818

1919
jobs:
2020
latest-changes:
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
latest_changes_file: ./release-notes.md
37-
latest_changes_header: '## Latest Changes'
38-
end_regex: '^## '
37+
latest_changes_header: "## Latest Changes"
38+
end_regex: "^## "
3939
debug_logs: true
40-
label_header_prefix: '### '
40+
label_header_prefix: "### "

.github/workflows/lint-backend.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint Backend
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
lint-backend:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.10"
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v2
24+
with:
25+
version: "0.4.15"
26+
enable-cache: true
27+
- run: uv run bash scripts/lint.sh
28+
working-directory: backend

.github/workflows/smokeshow.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Smokeshow
22

33
on:
44
workflow_run:
5-
workflows: [Test]
5+
workflows: [Test Backend]
66
types: [completed]
77

88
jobs:
@@ -16,17 +16,14 @@ jobs:
1616
steps:
1717
- uses: actions/setup-python@v5
1818
with:
19-
python-version: '3.9'
20-
19+
python-version: "3.10"
2120
- run: pip install smokeshow
22-
2321
- uses: actions/download-artifact@v4
2422
with:
2523
name: coverage-html
2624
path: backend/htmlcov
2725
github-token: ${{ secrets.GITHUB_TOKEN }}
2826
run-id: ${{ github.event.workflow_run.id }}
29-
3027
- run: smokeshow upload backend/htmlcov
3128
env:
3229
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}

.github/workflows/test-backend.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test Backend
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
test-backend:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.10"
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v2
24+
with:
25+
version: "0.4.15"
26+
enable-cache: true
27+
- run: docker compose down -v --remove-orphans
28+
- run: docker compose up -d db mailcatcher
29+
- name: Migrate DB
30+
run: uv run bash scripts/prestart.sh
31+
working-directory: backend
32+
- name: Run tests
33+
run: uv run bash scripts/tests-start.sh "Coverage for ${{ github.sha }}"
34+
working-directory: backend
35+
- run: docker compose down -v --remove-orphans
36+
- name: Store coverage files
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: coverage-html
40+
path: backend/htmlcov
41+
include-hidden-files: true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test Docker Compose
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
14+
test-docker-compose:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- run: docker compose build
20+
- run: docker compose down -v --remove-orphans
21+
- run: docker compose up -d --wait
22+
- name: Test backend is up
23+
run: curl http://localhost:8000/api/v1/utils/health-check
24+
- name: Test frontend is up
25+
run: curl http://localhost:5173
26+
- run: docker compose down -v --remove-orphans

.github/workflows/test.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ repos:
1010
args:
1111
- --unsafe
1212
- id: end-of-file-fixer
13-
exclude: ^frontend/src/client/.*
13+
exclude: |
14+
(?x)^(
15+
frontend/src/client/.*|
16+
backend/app/email-templates/build/.*
17+
)$
1418
- id: trailing-whitespace
1519
exclude: ^frontend/src/client/.*
1620
- repo: https://github.com/charliermarsh/ruff-pre-commit

0 commit comments

Comments
 (0)