File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11name : Validate 'setup-python'
22on :
33 push :
4+ branches :
5+ - master
6+ paths-ignore :
7+ - ' **.md'
48 pull_request :
9+ paths-ignore :
10+ - ' **.md'
511 schedule :
612 - cron : 0 0 * * *
713
Original file line number Diff line number Diff line change 11name : Main workflow
2- on : [push, pull_request]
2+ on :
3+ push :
4+ branches :
5+ - master
6+ paths-ignore :
7+ - ' **.md'
8+ pull_request :
9+ paths-ignore :
10+ - ' **.md'
311jobs :
412 run :
513 name : Run
2432
2533 - name : npm test
2634 run : npm test
35+
36+ - name : Run with setup-python 2.7
37+ uses : ./
38+ with :
39+ python-version : 2.7
40+ - name : Verify 2.7
41+ run : python __tests__/verify-python.py 2.7
42+
43+ - name : Run with setup-python 3.5
44+ uses : ./
45+ with :
46+ python-version : 3.5
47+ - name : Verify 3.5
48+ run : python __tests__/verify-python.py 3.5
49+
50+ - name : Run with setup-python 3.6
51+ uses : ./
52+ with :
53+ python-version : 3.6
54+ - name : Verify 3.6
55+ run : python __tests__/verify-python.py 3.6
56+
57+ - name : Run with setup-python 3.7
58+ uses : ./
59+ with :
60+ python-version : 3.7
61+ - name : Verify 3.7
62+ run : python __tests__/verify-python.py 3.7
63+
64+ - name : Run with setup-python 3.8
65+ uses : ./
66+ with :
67+ python-version : 3.8
68+ - name : Verify 3.8
69+ run : python __tests__/verify-python.py 3.8
70+
71+ - name : Run with setup-python 3.7.5
72+ uses : ./
73+ with :
74+ python-version : 3.7.5
75+ - name : Verify 3.7.5
76+ run : python __tests__/verify-python.py 3.7.5
77+
78+ - name : Run with setup-python 3.6.7
79+ uses : ./
80+ with :
81+ python-version : 3.6.7
82+ - name : Verify 3.6.7
83+ run : python __tests__/verify-python.py 3.6.7
84+
85+ - name : Run with setup-python 3.8.1
86+ uses : ./
87+ with :
88+ python-version : 3.8.1
89+ - name : Verify 3.8.1
90+ run : python __tests__/verify-python.py 3.8.1
Original file line number Diff line number Diff line change 1+ import sys
2+ argCount = len (sys .argv ) - 1
3+
4+ if argCount == 1 :
5+ expectedVersion = sys .argv [1 ]
6+ versions = len (expectedVersion .split ("." ))
7+ majorMinor = str (sys .version_info [0 ]) + '.' + str (sys .version_info [1 ])
8+
9+ if versions == 2 :
10+ # Test only major and minor version
11+ if expectedVersion != majorMinor :
12+ raise Exception ("Incorrect major + minor version detected\n Expected: " + expectedVersion + "\n Actual: " + majorMinor )
13+ elif versions == 3 :
14+ # Test major, minor and micro version
15+ majorMinorMicro = majorMinor + '.' + str (sys .version_info [2 ])
16+ if expectedVersion != majorMinorMicro :
17+ raise Exception ("Incorrect major + minor + micro version detected\n Expected: " + expectedVersion + "\n Actual: " + majorMinorMicro )
18+ else :
19+ raise Exception ("Incorrect number of arguments supplied" )
20+ print ("Correct version of Python " + expectedVersion + " detected" )
21+ else :
22+ raise Exception ("Incorrect number of arguments supplied" )
You can’t perform that action at this time.
0 commit comments