File tree Expand file tree Collapse file tree 5 files changed +93
-5
lines changed Expand file tree Collapse file tree 5 files changed +93
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Python
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main", "feature/*" ]
6
+ pull_request :
7
+ branches : [ "main" ]
8
+
9
+ env :
10
+ LOG_LEVEL : WARN
11
+
12
+ jobs :
13
+
14
+ build :
15
+ name : " Run CI"
16
+ strategy :
17
+ fail-fast : false
18
+ matrix :
19
+ os : [
20
+ " windows-latest" ,
21
+ " ubuntu-latest" ,
22
+ " macOS-latest"
23
+ ]
24
+ python : ["3.10"]
25
+ runs-on : ${{ matrix.os }}
26
+ steps :
27
+ - uses : actions/checkout@v3
28
+
29
+ - name : Setup Python
30
+ uses : actions/setup-python@master
31
+ with :
32
+ python-version : ${{ matrix.python }}
33
+
34
+ - name : Install
35
+ run : pip3 install --upgrade -r requirements.txt
36
+
37
+ - name : Test
38
+ run : |
39
+ python3 -m coverage run -m unittest discover -s src -p '*_test.py' --verbose
40
+
41
+ - name : Coverage
42
+ run : |
43
+ python3 -m coverage report
44
+
45
+ - name : Upload coverage reports to Codecov with GitHub Action
46
+ uses : codecov/codecov-action@v3
Original file line number Diff line number Diff line change 9
9
dependencies :
10
10
pip3 install -r requirements.txt
11
11
12
- # upgrade:
13
- # pip3 install --upgrade -r requirements.txt
12
+ update :
13
+ pip3 freeze > requirements.txt
14
+
15
+ upgrade :
16
+ pip3 install --upgrade -r requirements.txt
14
17
15
18
test : dependencies
16
19
python3 -m unittest discover -s src -p ' *_test.py'
17
20
21
+ coverage : test
22
+ python3 -m coverage run -m unittest discover -s src -p ' *_test.py' --verbose
23
+ python3 -m coverage report
24
+
25
+ coverage/html : coverage
26
+ python3 -m coverage html
27
+
18
28
clean :
19
29
pip3 freeze > unins ; pip3 uninstall -y -r unins ; rm unins
30
+ rm -fr .pytest_cache
31
+ rm -fr htmlcov
32
+ rm -fr src/__pycache__
33
+ rm .coverage
20
34
21
35
all : test coverage
Original file line number Diff line number Diff line change
1
+ services :
2
+ projecteuler-py :
3
+ image : projecteuler-py:latest
4
+ build :
5
+ context : .
6
+ target : testing
7
+ environment :
8
+ _DEBUG : ${_DEBUG}
9
+ volumes :
10
+ - ./coverage:/app/coverage
11
+ profiles : ["testing"]
12
+
13
+ projecteuler-py-dev :
14
+ image : projecteuler-py:dev
15
+ build :
16
+ context : .
17
+ target : development
18
+ environment :
19
+ _DEBUG : ${_DEBUG}
20
+ volumes :
21
+ - ./:/app
22
+ profiles : ["development"]
Original file line number Diff line number Diff line change
1
+ attrs == 22.1.0
2
+ coverage == 6.4.4
3
+ iniconfig == 1.1.1
4
+ packaging == 21.3
5
+ pluggy == 1.0.0
6
+ py == 1.11.0
7
+ pyparsing == 3.0.9
8
+ pytest == 7.1.2
9
+ tomli == 2.0.1
Original file line number Diff line number Diff line change @@ -15,6 +15,3 @@ def test_split(self):
15
15
# check that s.split fails when the separator is not a string
16
16
with self .assertRaises (TypeError ):
17
17
s .split (2 )
18
-
19
- if __name__ == '__main__' :
20
- unittest .main ()
You can’t perform that action at this time.
0 commit comments