Skip to content

Commit 0cd51ee

Browse files
committed
resolve gh actions
1 parent 630d61f commit 0cd51ee

File tree

4 files changed

+47
-62
lines changed

4 files changed

+47
-62
lines changed

.github/workflows/build_and_push.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ on:
1515
branches:
1616
- main
1717
paths:
18-
- '**.html'
19-
- '**.css'
20-
- '**.js'
21-
- '**.py'
22-
- '**.toml'
23-
- '**.svg'
18+
- "**.html"
19+
- "**.css"
20+
- "**.js"
21+
- "**.py"
22+
- "**.toml"
23+
- "**.svg"
24+
- "**.yaml"
2425

2526
concurrency:
2627
cancel-in-progress: true
@@ -69,7 +70,7 @@ jobs:
6970
run: |
7071
echo "IMAGE_NAME_LC=${IMAGE_NAME,,}" >> "${GITHUB_OUTPUT}"
7172
env:
72-
IMAGE_NAME: '${{ env.IMAGE_NAME }}'
73+
IMAGE_NAME: "${{ env.IMAGE_NAME }}"
7374

7475
- name: Get short SHA
7576
id: slug

.github/workflows/coverage_and_lint.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,39 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.11", "3.x"]
18+
python-version: ["3.12"]
1919

2020
name: "Type Coverage and Linting @ ${{ matrix.python-version }}"
2121
steps:
2222
- name: "Checkout Repository"
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
26+
submodules: "true"
2627

27-
- name: "Setup Python @ ${{ matrix.python-version }}"
28-
id: setup-python
29-
uses: actions/setup-python@v4
28+
- name: Setup uv @ ${{ matrix.python-version }}
29+
uses: astral-sh/setup-uv@v6
3030
with:
31-
python-version: "${{ matrix.python-version }}"
32-
cache: "pip"
31+
activate-environment: true
32+
enable-cache: true
33+
python-version: ${{ matrix.python-version }}
3334

34-
- name: "Install Python deps @ ${{ matrix.python-version }}"
35-
id: install-deps
35+
- name: Install deps @ ${{ matrix.python-version }}
3636
run: |
37-
pip install -Ur requirements.txt
37+
uv sync --all-extras --all-groups
38+
3839
- name: "Run Pyright @ ${{ matrix.python-version }}"
39-
uses: jakebailey/pyright-action@v1
40+
uses: jakebailey/pyright-action@v2
4041
with:
41-
no-comments: ${{ matrix.python-version != '3.x' }}
4242
warnings: false
43+
annotate: "${{ matrix.python-version != '3.x' }}"
44+
45+
- name: Lint check
46+
uses: astral-sh/ruff-action@v3
47+
with:
48+
args: check .
4349

44-
- name: Lint with Ruff
45-
if: ${{ always() && steps.install-deps.outcome == 'success' }}
46-
uses: chartboost/ruff-action@v1
50+
- name: Formatting check
51+
uses: astral-sh/ruff-action@v3
52+
with:
53+
args: format --check

.github/workflows/deploy.yaml

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

src/core/server.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ def __init__(self, *, database: Database, session: aiohttp.ClientSession | None
7979

8080
if CONFIG["SERVER"]["maintenance"]:
8181
# inject a catch all before any route...
82-
routes.extend((
83-
Route("/", self.maint_mode, methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]),
84-
Route("/{path:path}", self.maint_mode, methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]),
85-
))
82+
routes.extend(
83+
(
84+
Route("/", self.maint_mode, methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]),
85+
Route("/{path:path}", self.maint_mode, methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]),
86+
)
87+
)
8688

8789
super().__init__(on_startup=[self.event_ready], views=views, routes=routes, middleware=middleware)
8890

@@ -102,13 +104,15 @@ async def documents_redirect(self, _: starlette_plus.Request) -> starlette_plus.
102104
return starlette_plus.RedirectResponse("/api/paste", status_code=308)
103105

104106
async def event_ready(self) -> None:
105-
self.schemas = SchemaGenerator({
106-
"openapi": "3.1.0",
107-
"info": {
108-
"title": "MystBin API",
109-
"version": "4.0",
110-
"summary": "API Documentation",
111-
"description": "MystBin - Easily share code and text.",
112-
},
113-
})
107+
self.schemas = SchemaGenerator(
108+
{
109+
"openapi": "3.1.0",
110+
"info": {
111+
"title": "MystBin API",
112+
"version": "4.0",
113+
"summary": "API Documentation",
114+
"description": "MystBin - Easily share code and text.",
115+
},
116+
}
117+
)
114118
LOGGER.info("MystBin application has successfully started!")

0 commit comments

Comments
 (0)