-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (40 loc) · 1.13 KB
/
version.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
name: Test minimum required python version
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install vermin
- name: Test minimum required python version
run: |
function check_version() {
local version=$1
local major_version=${version:0:1}
if [[ major_version -eq "3" ]]; then
echo "major version is 3"
local minor_version=${version:2}
if [ $minor_version -lt "7" ]; then
echo "minor version is ${minor_version}; passed"
else
exit 127
fi
else
echo "major version is 2; passed"
fi
}
min_version=`vermin --no-tips --no-parse-comments ./ | grep "Minimum required versions: "`
check_version ${min_version:27}