-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (103 loc) · 3.49 KB
/
ci.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Continuous Integration
on:
push:
branches: [ "main", "ci" ]
pull_request:
branches: [ "main", "ci" ]
permissions:
contents: read
jobs:
black:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12-rc"]
debian_codename: ["bullseye", "bookworm"]
container:
image: ghcr.io/corvan/black:${{ matrix.python_version }}-${{ matrix.debian_codename }}
credentials:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: black
run: |
black $GITHUB_WORKSPACE/mailpit
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [ "3.9", "3.10", "3.11", "3.12-rc" ]
debian_codename: ["bullseye", "bookworm"]
container:
image: ghcr.io/corvan/lint:${{ matrix.python_version }}-${{ matrix.debian_codename }}
credentials:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: lint
run: |
ruff check $GITHUB_WORKSPACE/mailpit
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [ "3.9", "3.10", "3.11", "3.12-rc" ]
debian_codename: ["bullseye", "bookworm"]
container:
image: ghcr.io/corvan/mypy:${{ matrix.python_version }}-${{ matrix.debian_codename }}
credentials:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: mypy
env:
PYTHONPATH: /usr/lib/python3/dist-packages
run: |
python3 -m mypy --ignore-missing-imports $GITHUB_WORKSPACE/mailpit
unittest:
needs: ["black", "lint", "mypy"]
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [ "3.9", "3.10", "3.11", "3.12-rc" ]
debian_codename: ["bullseye", "bookworm"]
container:
image: ghcr.io/corvan/unittest:${{ matrix.python_version }}-${{ matrix.debian_codename }}
credentials:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: unittest
run: |
export PYTHONPATH=$GITHUB_WORKSPACE
pytest --showlocals --exitfirst --log-level=DEBUG -vv tests/unit
integration:
needs: [unittest]
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [ "3.9", "3.10", "3.11", "3.12-rc" ]
debian_codename: ["bullseye", "bookworm"]
container:
image: ghcr.io/corvan/integration:${{ matrix.python_version }}-${{ matrix.debian_codename }}
credentials:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
services:
mailpit:
image: axllent/mailpit:latest
ports:
- 8025:8025
- 1025:1025
steps:
- uses: actions/checkout@v3
- name: integration tests
run: |
export PYTHONPATH=$GITHUB_WORKSPACE
pytest --showlocals --exitfirst --log-level=DEBUG -vvs tests/integration