-
Notifications
You must be signed in to change notification settings - Fork 7
/
run_ci_light.bat
115 lines (95 loc) · 3.59 KB
/
run_ci_light.bat
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@ECHO OFF
ECHO.
ECHO.Please run this batch script as a substitute of the GitHub workflows before creating a pull request. This light
ECHO.version does not run the following CI pipelines:
ECHO.- CodeQL analysis (only used by GitHub)
ECHO.- Installing ConFlowGen from source in a fresh conda environment (not suitable for repeated invocation)
ECHO.
ECHO.This script needs to be invoked in the development environment, e.g., a virtual environment or a conda
ECHO.environment.
ECHO.
ECHO.The following Python interpreter is used:
python -c "import sys; print(sys.base_prefix)"
ECHO.The following sys.prefix is used (typically overwritten by the isolated environment you operate in):
python -c "import sys; print(sys.prefix)"
ECHO.
IF "%VIRTUAL_ENV%" NEQ "" (
ECHO.Operating inside the virtual environment %VIRTUAL_ENV%
GOTO START_PIPELINE
)
IF "%CONDA_PREFIX%" NEQ "" (
ECHO.Operating inside the conda environment %CONDA_PREFIX%
GOTO START_PIPELINE
)
ECHO.It seems like you are not in an isolated development environment. In a later step, the current version of
ECHO.ConFlowGen will be installed as a library. Please abort if you do not want to clutter your Python installation.
ECHO.If you actually are in an isolated development environment, feel free to improve this check.
:AGAIN
ECHO.
set /p answer="Continue anyway (Y/N)? "
if /i "%answer:~,1%" EQU "Y" goto START_PIPELINE
if /i "%answer:~,1%" EQU "N" exit /b
ECHO.Please type Y for Yes or N for No
GOTO AGAIN
:START_PIPELINE
REM Try the installation process - as a developer this is the default installation anyway
REM This also ships the commands that are used in the latter stages of the pipeline
REM try installation process - as a developer this is the default installation anyways
python -m pip install -e .[dev] || (
ECHO.Installation failed!
EXIT /B
)
REM run tests
set MPLBACKEND=agg
python -m pytest --exitfirst --verbose --failed-first --cov="./conflowgen" --cov-report html || (
ECHO.Tests failed!
EXIT /B
)
REM Please check the code coverage!
START "" ./htmlcov/index.html
REM check code quality
flake8 || (
ECHO.While linting, flake8 failed!
EXIT /B
)
flake8_nb || (
ECHO.While linting, flake8_nb failed!
EXIT /B
)
pylint conflowgen || (
ECHO.While linting the conflowgen module, pylint failed!
EXIT /B
)
pylint setup.py || (
ECHO.While linting setup.py, pylint failed!
EXIT /B
)
pylint conflowgen.tests || (
ECHO.While linting the conflowgen tests, pylint failed!
EXIT /B
)
REM build docs
CALL docs/make clean || (
ECHO.Cleaning up the last built of the documentation failed!
EXIT /B
)
CALL docs/make html || (
ECHO.Building the documentation failed!
ECHO.If you have issues with the SQLITE databases, consider running ./docs/download_prepared_sqlite_files.ps1
ECHO.If the issues remain, consider using your own up-to-date databases created by the demo scripts. You just need
ECHO.to copy those to the directories as indicated in the PowerShell script.
EXIT /B
)
REM Please check the docs!
START "" ./docs/_build/html/index.html
REM check the links in the docs
CALL python -m sphinx -W --keep-going ./docs/ ./docs/_build/linkcheck/ -b linkcheck || (
ECHO.The linkcheck has spotted an issue, please check!
EXIT /B
)
CALL python ./examples/Python_Script/demo_poc.py || (
ECHO.The proof-of-concept demo did not work, please check!
EXIT /B
)
ECHO.All steps were executed successfully. Please consider also checking the skipped CI steps manually if you changed
ECHO.related files. Please also consider running ./examples/Python_Script/demo_DEHAM_CTA.py after major changes.