-
Notifications
You must be signed in to change notification settings - Fork 2
171 lines (159 loc) · 6.48 KB
/
tests-and-codestyle.yaml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Tests and codestyle
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
notify-build-start:
# Secrets are not available for forks for security reasons, so pull
# request checks will fail when trying to send the Slack notification.
# Unfortunately, there's no way to explicitly check that a secret is
# available, so we check for event_name instead:
# https://github.com/actions/runner/issues/520
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: ivelum/github-action-slack-notify-build@v1.7.2
id: slack
with:
channel_id: C0PT3267R
status: STARTED
color: '#ee9b00'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
outputs:
status_message_id: ${{ steps.slack.outputs.message_id }}
tests:
strategy:
fail-fast: false
matrix:
include:
# See available Python/Ubuntu versions here:
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
# https://docs.djangoproject.com/en/dev/releases/5.1/
- {django: '5.1.*', python: '3.13', ubuntu: '24.04'}
- {django: '5.1.*', python: '3.12', ubuntu: '24.04'}
- {django: '5.1.*', python: '3.11', ubuntu: '24.04'}
- {django: '5.1.*', python: '3.10', ubuntu: '24.04'}
# https://docs.djangoproject.com/en/dev/releases/5.0/
- {django: '5.0.*', python: '3.12', ubuntu: '24.04'}
- {django: '5.0.*', python: '3.11', ubuntu: '24.04'}
- {django: '5.0.*', python: '3.10', ubuntu: '24.04'}
# https://docs.djangoproject.com/en/dev/releases/4.2/
- {django: '4.2.*', python: '3.12', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.11', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.10', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.9', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.8', ubuntu: '24.04'}
# https://docs.djangoproject.com/en/dev/releases/4.1/
- {django: '4.1.*', python: '3.11', ubuntu: '24.04'}
- {django: '4.1.*', python: '3.10', ubuntu: '24.04'}
- {django: '4.1.*', python: '3.9', ubuntu: '24.04'}
- {django: '4.1.*', python: '3.8', ubuntu: '24.04'}
# https://docs.djangoproject.com/en/dev/releases/4.0/
- {django: '4.0.*', python: '3.10', ubuntu: '24.04'}
- {django: '4.0.*', python: '3.9', ubuntu: '24.04'}
- {django: '4.0.*', python: '3.8', ubuntu: '24.04'}
# https://docs.djangoproject.com/en/dev/releases/3.2/
- {django: '3.2.*', python: '3.10', ubuntu: '24.04'}
- {django: '3.2.*', python: '3.9', ubuntu: '24.04'}
- {django: '3.2.*', python: '3.8', ubuntu: '24.04'}
- {django: '3.2.*', python: '3.7', ubuntu: '22.04'}
- {django: '3.2.*', python: '3.6', ubuntu: '20.04'}
# https://docs.djangoproject.com/en/dev/releases/3.1/
- {django: '3.1.*', python: '3.9', ubuntu: '24.04'}
- {django: '3.1.*', python: '3.8', ubuntu: '24.04'}
- {django: '3.1.*', python: '3.7', ubuntu: '22.04'}
- {django: '3.1.*', python: '3.6', ubuntu: '20.04'}
# https://docs.djangoproject.com/en/dev/releases/3.0/
- {django: '3.0.*', python: '3.9', ubuntu: '24.04'}
- {django: '3.0.*', python: '3.8', ubuntu: '24.04'}
- {django: '3.0.*', python: '3.7', ubuntu: '22.04'}
- {django: '3.0.*', python: '3.6', ubuntu: '20.04'}
# https://docs.djangoproject.com/en/dev/releases/2.2/
- {django: '2.2.*', python: '3.9', ubuntu: '24.04'}
- {django: '2.2.*', python: '3.8', ubuntu: '24.04'}
- {django: '2.2.*', python: '3.7', ubuntu: '22.04'}
- {django: '2.2.*', python: '3.6', ubuntu: '20.04'}
- {django: '2.2.*', python: '3.5', ubuntu: '20.04'}
runs-on: ubuntu-${{ matrix.ubuntu }}
steps:
- name: Ignore certificate verification on Python 3.5
if: matrix.python == 3.5
run: echo 'PIP_TRUSTED_HOST=pypi.python.org pypi.org files.pythonhosted.org' >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: cache pip
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-tests|${{ matrix.python }}|${{ matrix.django }}
- run: pip install Django==${{ matrix.django }}
- run: pip install -e .
- run: python setup.py test
- name: Notify slack fail
uses: ivelum/github-action-slack-notify-build@v1.7.2
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: C0PT3267R
status: FAILED
color: '#d7263d'
codestyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: cache pip
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-codestyle
- run: pip install -U flake8
- run: flake8
- name: Notify slack fail
uses: ivelum/github-action-slack-notify-build@v1.7.2
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel_id: C0PT3267R
status: FAILED
color: '#d7263d'
notify-build-success:
if: ${{ github.event_name == 'push' }}
needs: [tests, codestyle, notify-build-start]
runs-on: ubuntu-latest
steps:
- name: Notify slack success
uses: ivelum/github-action-slack-notify-build@v1.7.2
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0PT3267R
status: SUCCESS
color: '#16db65'