@@ -86,7 +86,152 @@ jobs:
86
86
id : setup-python
87
87
uses : ./
88
88
with :
89
- python-version-file : ' .python-version'
89
+ python-version-file : .python-version
90
+
91
+ - name : Check python-path
92
+ run : ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
93
+ shell : bash
94
+
95
+ - name : Validate version
96
+ run : |
97
+ $pythonVersion = (python --version)
98
+ if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
99
+ Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
100
+ exit 1
101
+ }
102
+ $pythonVersion
103
+ shell : pwsh
104
+
105
+ - name : Run simple code
106
+ run : python -c 'import math; print(math.factorial(5))'
107
+
108
+ setup-versions-from-file-without-parameter :
109
+ name : Setup ${{ matrix.python }} ${{ matrix.os }} version file without parameter
110
+ runs-on : ${{ matrix.os }}
111
+ strategy :
112
+ fail-fast : false
113
+ matrix :
114
+ os : [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
115
+ python : [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13]
116
+ exclude :
117
+ - os : ubuntu-22.04
118
+ python : 3.5.4
119
+ - os : ubuntu-22.04
120
+ python : 3.6.7
121
+ - os : ubuntu-22.04
122
+ python : 3.7.5
123
+ - os : windows-latest
124
+ python : 3.8.15
125
+ steps :
126
+ - name : Checkout
127
+ uses : actions/checkout@v3
128
+
129
+ - name : build-version-file ${{ matrix.python }}
130
+ run : echo ${{ matrix.python }} > .python-version
131
+
132
+ - name : setup-python ${{ matrix.python }}
133
+ id : setup-python
134
+ uses : ./
135
+
136
+ - name : Check python-path
137
+ run : ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
138
+ shell : bash
139
+
140
+ - name : Validate version
141
+ run : |
142
+ $pythonVersion = (python --version)
143
+ if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
144
+ Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
145
+ exit 1
146
+ }
147
+ $pythonVersion
148
+ shell : pwsh
149
+
150
+ - name : Run simple code
151
+ run : python -c 'import math; print(math.factorial(5))'
152
+
153
+ setup-versions-from-standard-pyproject-file :
154
+ name : Setup ${{ matrix.python }} ${{ matrix.os }} standard pyproject file
155
+ runs-on : ${{ matrix.os }}
156
+ strategy :
157
+ fail-fast : false
158
+ matrix :
159
+ os : [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
160
+ python : [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13]
161
+ exclude :
162
+ - os : ubuntu-22.04
163
+ python : 3.5.4
164
+ - os : ubuntu-22.04
165
+ python : 3.6.7
166
+ - os : ubuntu-22.04
167
+ python : 3.7.5
168
+ - os : windows-latest
169
+ python : 3.8.15
170
+ steps :
171
+ - name : Checkout
172
+ uses : actions/checkout@v3
173
+
174
+ - name : build-version-file ${{ matrix.python }}
175
+ run : |
176
+ echo '[project]
177
+ requires-python = "${{ matrix.python }}"
178
+ ' > pyproject.toml
179
+
180
+ - name : setup-python ${{ matrix.python }}
181
+ id : setup-python
182
+ uses : ./
183
+ with :
184
+ python-version-file : pyproject.toml
185
+
186
+ - name : Check python-path
187
+ run : ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
188
+ shell : bash
189
+
190
+ - name : Validate version
191
+ run : |
192
+ $pythonVersion = (python --version)
193
+ if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
194
+ Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
195
+ exit 1
196
+ }
197
+ $pythonVersion
198
+ shell : pwsh
199
+
200
+ - name : Run simple code
201
+ run : python -c 'import math; print(math.factorial(5))'
202
+
203
+ setup-versions-from-poetry-pyproject-file :
204
+ name : Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file
205
+ runs-on : ${{ matrix.os }}
206
+ strategy :
207
+ fail-fast : false
208
+ matrix :
209
+ os : [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
210
+ python : [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13]
211
+ exclude :
212
+ - os : ubuntu-22.04
213
+ python : 3.5.4
214
+ - os : ubuntu-22.04
215
+ python : 3.6.7
216
+ - os : ubuntu-22.04
217
+ python : 3.7.5
218
+ - os : windows-latest
219
+ python : 3.8.15
220
+ steps :
221
+ - name : Checkout
222
+ uses : actions/checkout@v3
223
+
224
+ - name : build-version-file ${{ matrix.python }}
225
+ run : |
226
+ echo '[tool.poetry.dependencies]
227
+ python = "${{ matrix.python }}"
228
+ ' > pyproject.toml
229
+
230
+ - name : setup-python ${{ matrix.python }}
231
+ id : setup-python
232
+ uses : ./
233
+ with :
234
+ python-version-file : pyproject.toml
90
235
91
236
- name : Check python-path
92
237
run : ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
0 commit comments