Skip to content

Commit ab869c6

Browse files
committed
Add CI files for unix
1 parent c5c15b2 commit ab869c6

File tree

4 files changed

+110
-7
lines changed

4 files changed

+110
-7
lines changed

ci/make_env.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
if [ -z "$1" ]
2+
then
3+
echo "Usage make_env.bat PYTHON_ENV_DIR"
4+
exit 1
5+
fi
6+
7+
# export PIP_INDEX_URL='https://pypi.python.org/pypi'
8+
# export PIP_TRUSTED_HOST='pypi.python.org'
9+
# export PIP_EXTRA_INDEX_URL='https://test.pypi.org/pypi'
10+
11+
export PYTHON_ENV_DIR=$1
12+
python -m venv $PYTHON_ENV_DIR
13+
source $PYTHON_ENV_DIR/bin/activate
14+
15+
python --version
16+
pip --version
17+
python -m pip install -U pip
18+
pip install -r $CI_PROJECT_DIR/ci/ci_requirements.txt

ci_build.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
export CI_PROJECT_DIR=.
4+
5+
# mvn clean does not remove them
6+
rm -rf .pytest_cache
7+
rm -rf .tox
8+
rm -rf .venv
9+
10+
source $CI_PROJECT_DIR/ci/make_env.sh .venv
11+
status=$?
12+
if [ $status -eq 0 ]
13+
then
14+
echo "Python venv was created"
15+
else
16+
echo "Cannot create Python venv"
17+
exit 1
18+
fi
19+
20+
pwd
21+
ls -la
22+
23+
python -m pytest --cov=jdmn-python-runtime --junitxml=test-reports/test_report.xml
24+
status=$?
25+
if [ $status -eq 0 ]
26+
then
27+
echo "pytest passed"
28+
else
29+
echo "pytest failed"
30+
exit 1
31+
fi
32+
python -m flake8
33+
status=$?
34+
if [ $status -eq 0 ]
35+
then
36+
echo "flake8 passed"
37+
else
38+
echo "flake8 failed"
39+
exit 1
40+
fi

pom.xml

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,15 @@
1616
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
1717
<modelVersion>4.0.0</modelVersion>
1818

19-
<parent>
20-
<groupId>com.goldmansachs.jdmn</groupId>
21-
<artifactId>jdmn-parent</artifactId>
22-
<version>6.2.1-SNAPSHOT</version>
23-
</parent>
24-
19+
<groupId>com.goldmansachs.jdmn</groupId>
2520
<artifactId>jdmn-python-runtime</artifactId>
26-
<name>jDMN: Core</name>
21+
<name>jDMN: Python Runtime</name>
22+
<version>1.0.6-SNAPSHOT</version>
2723
<packaging>jar</packaging>
2824

2925
<profiles>
3026
<profile>
27+
<id>it-windows</id>
3128
<activation>
3229
<os>
3330
<family>windows</family>
@@ -72,5 +69,52 @@
7269
</plugins>
7370
</build>
7471
</profile>
72+
73+
<profile>
74+
<id>it-linux</id>
75+
<activation>
76+
<os>
77+
<family>unix</family>
78+
</os>
79+
</activation>
80+
<build>
81+
<plugins>
82+
<plugin>
83+
<groupId>org.codehaus.mojo</groupId>
84+
<artifactId>exec-maven-plugin</artifactId>
85+
<version>3.5.0</version>
86+
<executions>
87+
<execution>
88+
<id>python-test</id>
89+
<phase>test</phase>
90+
<configuration>
91+
<executable>ci_build.sh</executable>
92+
<workingDirectory>${project.basedir}</workingDirectory>
93+
</configuration>
94+
<goals>
95+
<goal>exec</goal>
96+
</goals>
97+
</execution>
98+
<execution>
99+
<id>python-build</id>
100+
<phase>prepare-package</phase>
101+
<configuration>
102+
<executable>python</executable>
103+
<workingDirectory>${project.basedir}</workingDirectory>
104+
<arguments>
105+
<argument>setup.py</argument>
106+
<argument>sdist</argument>
107+
<argument>bdist_wheel</argument>
108+
</arguments>
109+
</configuration>
110+
<goals>
111+
<goal>exec</goal>
112+
</goals>
113+
</execution>
114+
</executions>
115+
</plugin>
116+
</plugins>
117+
</build>
118+
</profile>
75119
</profiles>
76120
</project>

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ commands =
5353
python setup.py check -r -s
5454

5555
[flake8]
56+
exclude = .pytest_cache, .tox, .venv, build, dist
5657
extend-ignore =
5758
# Missing docstrings
5859
D100, D101, D102, D104, D105, D107

0 commit comments

Comments
 (0)