Skip to content

Commit 820729b

Browse files
committed
Update actions workflow
1 parent 4b7f583 commit 820729b

File tree

3 files changed

+29
-37
lines changed

3 files changed

+29
-37
lines changed

.github/workflows/lint.yml

+18-22
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,21 @@ jobs:
1515
python-version: ["3.11"]
1616
name: Python ${{ matrix.python-version }} on ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
19-
- name: Set up Python
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
architecture: x64
24-
- uses: Gr1N/setup-poetry@v9
25-
- name: Cache poetry
26-
id: cache-poetry
27-
uses: actions/[email protected]
28-
with:
29-
path: ~/.cache/pypoetry/virtualenvs
30-
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
31-
- name: Maybe install dependencies
32-
if: steps.cache-venv.outputs.cache-hit != 'true'
33-
run: poetry install --no-root --only dev
34-
- name: Ruff
35-
run: poetry run ruff . --no-fix --config pyproject.toml
36-
continue-on-error: true
37-
- name: Black
38-
run: |
39-
poetry run black . --diff --check --config pyproject.toml
18+
- uses: actions/checkout@v4
19+
20+
- name: Install uv and set the python version
21+
uses: astral-sh/setup-uv@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
enable-cache: true
25+
cache-dependency-glob: "uv.lock"
26+
27+
- name: Install the project
28+
run: uv sync --all-extras --dev
29+
30+
- name: Run ruff linter
31+
run: uv run ruff . --no-fix --config pyproject.toml
32+
continue-on-error: true
33+
- name: Run black linter
34+
run: |
35+
uv run black . --diff --check --config pyproject.toml

.github/workflows/load-check.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Load test
33
on:
44
push:
55
branches:
6-
- stable
76
- develop
87

98
jobs:
@@ -17,27 +16,24 @@ jobs:
1716
name: Load Modmail - Python ${{ matrix.python-version }}
1817
steps:
1918
- uses: actions/checkout@v4
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v5
19+
20+
- name: Install uv and set the python version
21+
uses: astral-sh/setup-uv@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
- uses: Gr1N/setup-poetry@v9
25-
- name: Cache poetry
26-
id: cache-poetry
27-
uses: actions/[email protected]
28-
with:
29-
path: ~/.cache/pypoetry/virtualenvs
30-
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
31-
- name: Maybe install dependencies
32-
if: steps.cache-venv.outputs.cache-hit != 'true'
33-
run: poetry install --no-root
24+
enable-cache: true
25+
cache-dependency-glob: "uv.lock"
26+
27+
- name: Install the project
28+
run: uv sync
29+
3430
- name: Run script loadcheck.py
3531
run: |
3632
poetry run python .github/workflows/scripts/loadcheck.py
3733
env:
3834
TOKEN: ${{ secrets.DISCORD_TEST_BOT }}
3935
CONNECTION_URI: ${{ secrets.CONNECTION_URI }}
40-
LOG_URL: https://domain.example
36+
LOG_URL: https://example.com
4137
GUILD_ID: "1100011945207271494"
4238
OWNERS: "243316261264556032,505386507440488458"
4339
LOG_LEVEL: DEBUG

.github/workflows/scripts/loadcheck.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
file = open("modmail.log", "w")
1616
proc = subprocess.Popen(
17-
"poetry run python bot.py",
17+
"uv run python bot.py",
1818
stdout=file,
1919
stderr=subprocess.STDOUT,
2020
shell=True,

0 commit comments

Comments
 (0)