-
Notifications
You must be signed in to change notification settings - Fork 108
171 lines (168 loc) · 5.22 KB
/
cicd.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: Continuous Integration & Delivery
on:
pull_request:
branches: [ master ]
workflow_dispatch:
branches: [ master, actions ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python: 3.8
django: 3.2
toxenv: py38-django32
- python: 3.9
django: 3.2
toxenv: py39-django32
- python: 3.8
django: 4.0
toxenv: py38-django40
- python: 3.9
django: 4.0
toxenv: py39-django40
- python: '3.10'
django: 4.0
toxenv: py310-django40
- python: 3.8
django: 4.1
toxenv: py38-django41
- python: 3.9
django: 4.1
toxenv: py39-django41
- python: '3.10'
django: 4.1
toxenv: py310-django41
- python: '3.10'
django: 5.0
toxenv: py310-django50
- python: '3.11'
django: 5.0
toxenv: py311-django50
- python: '3.12'
django: 5.0
toxenv: py312-django50
- python: '3.10'
django: 5.1
toxenv: py310-django51
- python: '3.11'
django: 5.1
toxenv: py311-django51
- python: '3.12'
django: 5.1
toxenv: py312-django51
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
name: Set up Python ${{ matrix.python }} ${{ matrix.django }}
with:
python-version: ${{ matrix.python }}
- name: Install pip packages
run: |
pip install pip --upgrade
pip install codecov poetry tox
- name: "Run tox - testenv: ${{ matrix.toxenv }}"
env:
DJANGO: ${{ matrix.django }}
TOXENV: ${{ matrix.toxenv }}
run: tox
- name: Run notification script
env:
GITHUB_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GITHUB_JOB_STATUS: ${{ job.status }}
GITHUB_RUN_URL: ${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
run: ./scripts/notification.sh
quality:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python: 3.9
toxenv: quality
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
name: Set up Python ${{ matrix.python }}
with:
python-version: ${{ matrix.python }}
- name: Install pip packages
run: |
pip install pip --upgrade
pip install poetry tox
- name: "Run tox - testenv: ${{ matrix.toxenv }}"
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
security:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python: 3.9
toxenv: security
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
name: Set up Python ${{ matrix.python }}
with:
python-version: ${{ matrix.python }}
- name: Install pip packages
run: |
pip install pip --upgrade
pip install poetry tox
- name: "Run tox - testenv: ${{ matrix.toxenv }}"
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
# # AUTHOR: Lukasz Dynowski
# # TODO: Uncomment this code only if we agreed for Continuous Delivery.
# # TODO: Update PYPI envars to production values!
# publish:
# needs:
# - test
# - security
# - quality
# runs-on: ubuntu-latest
# strategy:
# matrix:
# include:
# - python: 3.6
# toxenv: build
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v1
# name: Set up Python ${{ matrix.python }}
# with:
# python-version: ${{ matrix.python }}
# - name: Install pip packages
# run: |
# pip install pip --upgrade
# pip install poetry tox
# - name: Bump package version
# run: ./scripts/bump.py --dry-run no
# - name: "Build package - testenv: ${{ matrix.toxenv }}"
# env:
# TOXENV: ${{ matrix.toxenv }}
# run: tox
# - name: "Publish - testenv: ${{ matrix.toxenv }}"
# env:
# PYPI_ACCESS_TOKEN: ${{ secrets.PYPI_ACCESS_TOKEN }}
# # Values production 'https://pypi.org/', testing 'https://test.pypi.org/legacy/'
# PYPI_REPOSITORY_URL: https://test.pypi.org/legacy/
# # Values production 'pypi', testing 'testpypi'
# PYPI_REPOSITORY: testpypi
# PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
# run: |
# poetry config repositories.$PYPI_REPOSITORY $PYPI_REPOSITORY_URL
# poetry config pypi-token.$PYPI_REPOSITORY $PYPI_ACCESS_TOKEN
# poetry publish -r $PYPI_REPOSITORY -u $PYPI_USERNAME
# - name: Create bump commit
# uses: EndBug/add-and-commit@latest
# with:
# author_name: github_actions
# author_email: github_actions
# message: PR Auto bumping package version
# add: pyproject.toml