chore: separate runtime and dev dependencies, add pytest config and CI cache
Build and publish container / build (push) Successful in 8m20s
Build and publish container / build (push) Successful in 8m20s
This commit is contained in:
@@ -46,10 +46,19 @@ jobs:
|
|||||||
python-version: 3.12
|
python-version: 3.12
|
||||||
|
|
||||||
- name: Install test dependencies
|
- name: Install test dependencies
|
||||||
run: python -m pip install --upgrade pip && pip install -r requirements.txt
|
run: python -m pip install --upgrade pip && pip install -r requirements-dev.txt
|
||||||
|
|
||||||
|
- name: Cache pip dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: "$RUNNER_OS-pip-${{ hashFiles('requirements-dev.txt') }}"
|
||||||
|
restore-keys: |
|
||||||
|
$RUNNER_OS-pip-
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: pytest -q
|
run: python -m pytest -q
|
||||||
|
|
||||||
- name: Determine registry host
|
- name: Determine registry host
|
||||||
run: echo "REGISTRY=${GITHUB_SERVER_URL#*://}" >> "$GITHUB_ENV"
|
run: echo "REGISTRY=${GITHUB_SERVER_URL#*://}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,13 @@ docker run --rm -p 110:110 -p 25:25 \
|
|||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
Run tests locally with:
|
Install development dependencies and run the test suite:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
python -m venv .venv
|
||||||
|
source .venv/bin/activate
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements-dev.txt
|
||||||
pytest -q
|
pytest -q
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[pytest]
|
||||||
|
minversion = 7.0
|
||||||
|
testpaths = tests
|
||||||
|
python_files = test_*.py
|
||||||
|
addopts = -q
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-r requirements.txt
|
||||||
|
pytest>=8.0.0
|
||||||
@@ -1,2 +1 @@
|
|||||||
aiosmtpd>=1.4.6,<1.5
|
aiosmtpd>=1.4.6,<1.5
|
||||||
pytest>=8.0.0
|
|
||||||
|
|||||||
Reference in New Issue
Block a user