File tree Expand file tree Collapse file tree 9 files changed +130
-0
lines changed
Expand file tree Collapse file tree 9 files changed +130
-0
lines changed Original file line number Diff line number Diff line change 1+ # codecov can find this file anywhere in the repo, so we don't need to clutter
2+ # the root folder.
3+ # comment: false
4+
5+ codecov :
6+ notify :
7+ require_ci_to_pass : no
8+
9+ coverage :
10+ status :
11+ patch :
12+ default :
13+ target : ' 70'
14+ if_no_uploads : error
15+ if_not_found : success
16+ if_ci_failed : failure
17+ project :
18+ default : false
19+ library :
20+ target : auto
21+ if_no_uploads : error
22+ if_not_found : success
23+ if_ci_failed : failure
24+ paths : ' !*/tests/.*'
25+
26+ tests :
27+ target : 97.9%
28+ paths : ' */tests/.*'
29+ if_not_found : success
30+
31+ flags :
32+ tests :
33+ paths :
34+ - tests/
Original file line number Diff line number Diff line change @@ -14,9 +14,18 @@ exclude_lines =
1414 ^[ ]*@unittest.skip\b
1515 ^[ ]{4}unittest.main()
1616 if __name__ == .__main__.:
17+ omit =
18+ */python?.?/*
19+ */site-packages/nose/*
20+ # ignore _version.py and versioneer.py
21+ .*version.*
22+ *_version.py
1723
1824
1925[run]
26+ source =
27+ src/diffpy/utils/
2028omit =
2129 # # exclude debug.py from codecov report
2230 */tests/debug.py
31+
Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ workflow_dispatch :
9+
10+ jobs :
11+ miniconda :
12+ name : Miniconda ${{ matrix.os }}
13+ runs-on : ${{ matrix.os }}
14+ strategy :
15+ matrix :
16+ os : ["ubuntu-latest"]
17+ steps :
18+ - name : check out diffpy.utils
19+ uses : actions/checkout@v3
20+ with :
21+ repository : diffpy/diffpy.utils
22+ path : .
23+
24+ - name : initialize miniconda
25+ # this uses a marketplace action that sets up miniconda in a way that makes
26+ # it easier to use. I tried setting it up without this and it was a pain
27+ uses : conda-incubator/setup-miniconda@v2
28+ with :
29+ activate-environment : test
30+ # environment.yml file is needed by this action. Because I don't want
31+ # maintain this but rather maintain the requirements files it just has
32+ # basic things in it like conda and pip
33+ environment-file : ./environment.yml
34+ python-version : 3
35+ auto-activate-base : false
36+
37+ - name : install diffpy.utils requirements
38+ shell : bash -l {0}
39+ run : |
40+ conda config --set always_yes yes --set changeps1 no
41+ conda config --add channels conda-forge
42+ conda activate test
43+ conda install --file requirements/run.txt
44+ conda install --file requirements/test.txt
45+ pip install .
46+
47+ - name : Validate diffpy.utils
48+ shell : bash -l {0}
49+ run : |
50+ conda activate test
51+ coverage run run_tests.py
52+ coverage report -m
53+ codecov
54+
Original file line number Diff line number Diff line change 11Pavol Juhas
2+ Andrew yang
23Timur Davis
34Christopher L. Farrow
45Simon J.L. Billinge
6+
Original file line number Diff line number Diff line change 1+ name : diffpy.utils
2+ channels :
3+ - conda-forge
4+ dependencies :
5+ - python=3
6+ - pip
Original file line number Diff line number Diff line change 1+ sphinx
2+ sphinx_rtd_theme
3+ doctr
Original file line number Diff line number Diff line change 1+ flake8
2+ pytest
3+ codecov
4+ coverage
5+ pytest-env
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ import sys
4+ import pytest
5+
6+ if __name__ == '__main__' :
7+ # show output results from every test function
8+ args = ['-v' ]
9+ # show the message output for skipped and expected failure tests
10+ if len (sys .argv ) > 1 :
11+ args .extend (sys .argv [1 :])
12+ print ('pytest arguments: {}' .format (args ))
13+ # # compute coverage stats for xpdAcq
14+ # call pytest and exit with the return code from pytest so that
15+ # travis will fail correctly if tests fail
16+ exit_res = pytest .main (args )
17+ sys .exit (exit_res )
You can’t perform that action at this time.
0 commit comments