@@ -38,11 +38,11 @@ jobs:
3838 with :
3939 python-version : " 3.13"
4040 cache : " pip"
41- cache-dependency-path : " requirements/dev.txt "
41+ cache-dependency-path : " pyproject.toml "
4242 - name : " Install dependencies"
4343 run : |
4444 python -m pip install --upgrade pip
45- pip install -r requirements/ dev.txt
45+ pip install . --group dev
4646 - name : " Run codespell"
4747 run :
4848 codespell --ignore-words-list="groupt,nd,ot,ro,falsy,BU" \
@@ -58,11 +58,11 @@ jobs:
5858 with :
5959 python-version : " 3.13"
6060 cache : " pip"
61- cache-dependency-path : " requirements/dev.txt "
61+ cache-dependency-path : " pyproject.toml "
6262 - name : " Install dependencies"
6363 run : |
6464 python -m pip install --upgrade pip
65- pip install -r requirements/ dev.txt
65+ pip install . --group dev
6666 - name : " Run bandit"
6767 run : bandit --recursive --skip B101,B104,B105,B110,B307,B311,B404,B603,B607 .
6868 pylint :
@@ -76,11 +76,11 @@ jobs:
7676 with :
7777 python-version : " 3.13"
7878 cache : " pip"
79- cache-dependency-path : " requirements/dev.txt "
79+ cache-dependency-path : " pyproject.toml "
8080 - name : " Install dependencies"
8181 run : |
8282 python -m pip install --upgrade pip
83- pip install -r requirements/ dev.txt
83+ pip install . --group dev
8484 - name : " Setup cache"
8585 id : cache-pylint
8686 uses : actions/cache@v5
@@ -100,11 +100,11 @@ jobs:
100100 with :
101101 python-version : " 3.13"
102102 cache : " pip"
103- cache-dependency-path : " requirements/dev.txt "
103+ cache-dependency-path : " pyproject.toml "
104104 - name : " Install dependencies"
105105 run : |
106106 python -m pip install --upgrade pip
107- pip install -r requirements/ dev.txt
107+ pip install . --group dev
108108 - name : " Setup cache"
109109 id : cache-mypy
110110 uses : actions/cache@v5
@@ -116,39 +116,58 @@ jobs:
116116 run : mkdir -p -v .mypy_cache
117117 - name : " Run mypy"
118118 run : mypy --non-interactive discord/
119- pytest :
120- strategy :
121- matrix :
122- os : [ubuntu-latest, macos-latest, windows-latest]
123- python-version : ["3.10", "3.11", "3.12", "3.13"]
124- runs-on : ${{ matrix.os }}
125- env :
126- OS : ${{ matrix.os }}
127- PYTHON : ${{ matrix.python-version }}
119+ flake8 :
120+ runs-on : ubuntu-latest
128121 steps :
129122 - name : " Checkout Repository"
130123 uses : actions/checkout@v6
131124 - name : " Setup Python"
132125 uses : actions/setup-python@v6
133126 with :
134- python-version : ${{ matrix.python-version }}
127+ python-version : " 3.13 "
135128 cache : " pip"
136- cache-dependency-path : " requirements/dev.txt"
137- check-latest : true
129+ cache-dependency-path : " pyproject.toml"
138130 - name : " Install dependencies"
139131 run : |
140132 python -m pip install --upgrade pip
141- pip install flake8
142- pip install -r requirements/dev.txt
143- - name : " Setup cache"
144- id : cache-pytest
145- uses : actions/cache@v5
146- with :
147- path : .pytest_cache
148- key : ${{ matrix.os }}-${{ matrix.python-version }}-pytest
133+ pip install . --group dev
149134 - name : " Lint with flake8"
150135 run : |
151- # stop the build if there are Python syntax errors or undefined names
152136 flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
153- # exit-zero treats all errors as warnings.
154137 flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
138+ tests :
139+ if : ${{ github.event_name != 'schedule' }}
140+ runs-on : ${{ matrix.os }}
141+ strategy :
142+ matrix :
143+ os : [ubuntu-latest, windows-latest, macos-latest]
144+ python-version : ["3.10", "3.11", "3.12", "3.13"]
145+ steps :
146+ - name : " Checkout Repository"
147+ uses : actions/checkout@v6
148+
149+ - name : " Setup Python"
150+ uses : actions/setup-python@v6
151+ with :
152+ python-version : " 3.13"
153+ cache : " pip"
154+ cache-dependency-path : " pyproject.toml"
155+
156+ - name : " Install dependencies"
157+ run : |
158+ python -m pip install --upgrade pip
159+ pip install . --group dev
160+
161+ - name : " Run tests"
162+ run : tox
163+ tests-pass : # ref: https://github.com/orgs/community/discussions/4324#discussioncomment-3477871
164+ runs-on : ubuntu-latest
165+ needs : [tests]
166+ if : always() && github.event_name != 'schedule'
167+ steps :
168+ - name : Tests succeeded
169+ if : ${{ !(contains(needs.*.result, 'failure')) }}
170+ run : exit 0
171+ - name : Tests failed
172+ if : ${{ contains(needs.*.result, 'failure') }}
173+ run : exit 1
0 commit comments