-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (49 loc) · 1.4 KB
/
discord_bot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Lint, test and format discord_bot
on:
workflow_dispatch:
pull_request:
paths:
- "discord_bot/**"
workflow_run:
workflows: ["Dependabot PR Check"]
types:
- completed
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.7"]
defaults:
run:
working-directory: discord_bot
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: "discord_bot"
sparse-checkout-cone-mode: false
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 📜 Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: 🚀 Cache the venv based on the .lock
uses: actions/cache@v3
with:
path: discord_bot/.venv
key: venv-${{ hashFiles('discord_bot/poetry.lock') }}
- name: 🔨 Install dev dependencies
run: poetry install --with dev
- name: 🧑🔧 Lint with ruff
run: poetry run ruff check .
- name: 🧹 Format with black
run: poetry run black --check .
- name: 🧪 Run tests
run: poetry run pytest