forked from acoomans/flask-autodoc
-
Notifications
You must be signed in to change notification settings - Fork 4
176 lines (143 loc) · 6.14 KB
/
test.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
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
172
173
174
175
176
name: Run full set of Python tests
on:
- pull_request
jobs:
testing:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.x']
flask-version: ['1.0', '1.1', '2.0', '2.1', 'latest']
os: [ubuntu-20.04, macos-latest, windows-latest]
exclude:
# starting from Flask 2.1.0, python 3.6 is no longer supported:
- flask-version: '2.1'
python-version: '3.6'
- flask-version: 'latest'
python-version: '3.6'
# old versions of Flask no longer working with python >= 3.10:
- flask-version: '1.0'
python-version: '3.10'
- flask-version: '1.0'
python-version: '3.x'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dev dependencies (python 3.6)
if: matrix.python-version == '3.6'
run: |
pip3 install poetry
poetry export --dev --without-hashes --format requirements.txt --output requirements-dev.txt
pip3 install -r requirements-dev.txt
- name: Install Flask ${{ matrix.flask-version }}
if: matrix.flask-version != 'latest'
run: pip3 install Flask==${{ matrix.flask-version }}
- name: Install latest Flask
if: matrix.flask-version == 'latest'
run: pip3 install Flask
- name: Install dev dependencies (python >= 3.7)
if: matrix.python-version != '3.6'
run: |
pip3 install poetry
poetry export --only dev --format requirements.txt --output requirements-dev.txt
pip3 install -r requirements-dev.txt
- name: Overwrite Flask dependencies for legacy install
if: matrix.flask-version < '2.0' && matrix.flask-version != 'latest'
run: |
pip3 install "Jinja2<3.0"
pip3 install "MarkupSafe<=2.0.1"
pip3 install "itsdangerous<=2.0.1"
- name: Overwrite Flask dependencies for legacy install (2)
if: matrix.flask-version < '2.1' && matrix.flask-version != 'latest'
run: pip3 install "werkzeug<=2.0.3"
- name: List installed package versions for manual inspection
run: python3 --version && pip3 list
- name: Run unit tests
run: python3 -c "from run_tests import test; test()"
- name: Run doctests
run: python3 -c "from run_tests import run_doctest; run_doctest()"
check_pip_install:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.x']
flask-version: ['1.0', '1.1', '2.0', '2.1', 'latest']
os: [ubuntu-20.04, macos-latest, windows-latest]
exclude:
# starting from Flask 2.1.0, python 3.6 is no longer supported:
- flask-version: '2.1'
python-version: '3.6'
- flask-version: 'latest'
python-version: '3.6'
# old versions of Flask no longer working with python >= 3.10:
- flask-version: '1.0'
python-version: '3.10'
- flask-version: '1.0'
python-version: '3.x'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dev dependencies (python 3.6)
# actually installs all dependencies (no --only flag in this version)
# so we run this without installing the target Flask version
if: matrix.python-version == '3.6'
run: |
pip3 install poetry
poetry export --dev --without-hashes --format requirements.txt --output requirements-dev.txt
pip3 install -r requirements-dev.txt
- name: Install Flask ${{ matrix.flask-version }}
if: matrix.flask-version != 'latest'
run: pip3 install Flask==${{ matrix.flask-version }}
- name: Install latest Flask
if: matrix.flask-version == 'latest'
run: pip3 install Flask
- name: Install current flask-selfdoc from GitHub (linux/macOS)
if: matrix.os != 'windows-latest'
run: |
git_url="${{ github.event.pull_request.head.repo.git_url }}@${{ github.event.pull_request.head.ref }}"
git_url="git+https${git_url:3}"
pip3 install ${git_url}
- name: Install current flask-selfdoc from GitHub (windows)
if: matrix.os == 'windows-latest'
run: |
$git_url = "${{ github.event.pull_request.head.repo.git_url }}@${{ github.event.pull_request.head.ref }}"
$git_url = $git_url.subString(3)
$git_url = "git+https$git_url"
pip3 install $git_url
- name: Install dev dependencies (python >= 3.7)
if: matrix.python-version != '3.6'
run: |
pip3 install poetry
poetry export --only dev --format requirements.txt --output requirements-dev.txt
pip3 install -r requirements-dev.txt
- name: Overwrite Flask dependencies for legacy install
if: matrix.flask-version < '2.0' && matrix.flask-version != 'latest'
run: |
pip3 install "Jinja2<3.0"
pip3 install "MarkupSafe<=2.0.1"
pip3 install "itsdangerous<=2.0.1"
- name: Overwrite Flask dependencies for legacy install (2)
if: matrix.flask-version < '2.1' && matrix.flask-version != 'latest'
run: pip3 install "werkzeug<=2.0.3"
- name: List installed package versions for manual inspection
run: python3 --version && pip3 list
- name: Check that Flask version did not change
# not implemented for windows yet
if: matrix.flask-version != 'latest' && matrix.os != 'windows-latest'
run: |
flask_version=$(pip3 show Flask | grep Version:)
echo "found Flask ${flask_version}"
if [[ $(pip3 show Flask | grep Version) == *"Version: ${{ matrix.flask-version }}"* ]]
then
echo "No reinstall of Flask was done 👍"
else
exit 1
fi
- name: Try importing flask_selfdoc
run: python3 -c "import flask_selfdoc"