Skip to content

Commit ef0cb8f

Browse files
committed
Don't upload in tests from PRs
1 parent 81bfeb9 commit ef0cb8f

File tree

3 files changed

+143
-4
lines changed

3 files changed

+143
-4
lines changed

.github/workflows/pr.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Windows Tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: windows-2016
8+
strategy:
9+
max-parallel: 4
10+
matrix:
11+
cgal_branch: [master]
12+
python_minor_version: [6, 7, 8]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Set up Python 3.${{ matrix.python_minor_version }}
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: 3.${{ matrix.python_minor_version }}
23+
24+
25+
- name: Set up JDK 1.8
26+
uses: actions/setup-java@v1
27+
with:
28+
java-version: 1.8
29+
30+
- name: Setup Conda
31+
run: |
32+
echo ::add-path::C:/Miniconda/condabin;
33+
echo ::add-path::C:/Miniconda/Library/bin;
34+
35+
- name: Install dependencies
36+
run: |
37+
conda install -y -c anaconda swig
38+
conda install -y -c conda-forge bzip2
39+
conda install -y -c conda-forge zlib
40+
conda install -y -c conda-forge eigen
41+
conda install -y -c conda-forge mpfr
42+
conda install -y -c conda-forge mpir
43+
#conda install -y -c conda-forge cgal-cpp --only-deps
44+
python.exe -m pip install --upgrade pip
45+
pip install numpy
46+
pip install wheel
47+
pip install twine
48+
49+
50+
- name: Install CGAL and other dependencies
51+
run: |
52+
# ==- Install Boost -==
53+
#$Env:BOOST_ROOT_1_72_0/lib/*.dll C:\Miniconda\Library\bin
54+
echo ::add-path::$Env:BOOST_ROOT_1_72_0;
55+
echo ::add-path::$Env:pythonLocation;
56+
57+
# ==-Install CGAL-==
58+
echo "Cloning CGAL"
59+
git clone https://github.com/CGAL/cgal.git C:\cgal
60+
cd C:\cgal
61+
#git checkout releases/CGAL-5.0.2
62+
echo "CGAL cloned"
63+
64+
# ==-Install LAStools-==
65+
git clone https://github.com/CGAL/LAStools.git C:\LAStools
66+
cd C:\LAStools
67+
mkdir build
68+
cd C:\LAStools\build
69+
cmake -G "Visual Studio 15 2017 Win64" C:\LAStools -DCMAKE_INSTALL_PREFIX=C:/Miniconda/Library
70+
cmake --build . --config Release
71+
cmake --install . --config Release
72+
#fix error in installation
73+
mv C:/Miniconda/Library/lib/las.dll C:/Miniconda/Library/bin/las.dll
74+
mv C:/Miniconda/Library/include/LASlib/* C:/Miniconda/Library/include/
75+
mv C:/Miniconda/Library/include/LASzip/* C:/Miniconda/Library/include/
76+
77+
# ==-Install TBB-==
78+
#$WebClient = New-Object System.Net.WebClient
79+
#$WebClient.DownloadFile("https://github.com/oneapi-src/oneTBB/releases/download/2019_U9/tbb2019_20191006oss_win.zip", "C:\tbb.zip")
80+
#Expand-Archive C:\tbb.zip C:\
81+
#rm C:\tbb2019_20191006oss\bin\intel64\vc14\*_debug*
82+
#rm C:\tbb2019_20191006oss\lib\intel64\vc14\*_debug*
83+
#mv C:\tbb2019_20191006oss\bin\intel64\vc14\*.dll C:\Miniconda\Library\bin
84+
#cd C:\tbb2019_20191006oss
85+
#C:\tbb2019_20191006oss\bin\tbbvars.bat intel64 vs2015
86+
#mv include\* C:\Miniconda\Library\include
87+
#mv lib\intel64\vc14\* C:\Miniconda\Library\lib
88+
89+
90+
91+
- name: Check Installation
92+
run: |
93+
echo "Path content : $Env:PATH"
94+
#echo "C:\boost_1_69_0\lib content"
95+
#ls C:\boost_1_69_0\lib
96+
97+
# - name: Build Tests
98+
# run: |
99+
# mkdir build
100+
# cd build
101+
# cmake -G "Visual Studio 15 2017" -T"v140" -A x64 -DBUILD_JAVA=ON -DBUILD_PYTHON=ON -DBUILD_TESTING=ON -DCMAKE_PREFIX_PATH="C:/Miniconda/Library" -DBUILD_SHARED_LIBS=ON ..
102+
# cmake --build . --config Release
103+
# cmake --build . --config Release --target tests
104+
# echo ::add-path::D:/a/cgal-swig-bindings/cgal-swig-bindings/build/lib/Release;
105+
# echo ::add-path::D:/a/cgal-swig-bindings/cgal-swig-bindings/build/build-java/lib/;
106+
#
107+
# - name: Run Tests
108+
# run: |
109+
# cd build
110+
# ctest -C Release -j8 -VV
111+
112+
- name: Test Setup
113+
run: |
114+
python.exe setup.py bdist_wheel --cmake-prefix-path="C:/Miniconda/Library" --boost-root="$Env:BOOST_ROOT_1_72_0" --generator="Visual Studio 15 2017 Win64" --cgal-dir=C:/cgal --python-root="$pythonLocation"
115+
pip install dist/*
116+
shell: bash
117+
118+
- name: Test Installation
119+
run: |
120+
set -e
121+
cd examples/python
122+
for py_file in *.py; do
123+
python.exe $py_file || exit 1
124+
done
125+
shell: bash
126+
127+
# - name: Upload wheel
128+
# uses: actions/upload-artifact@v1
129+
# if: failure()
130+
# with:
131+
# name: wheel
132+
# path: dist/cgal-5.0.2-cp37-cp37m-win_amd64.whl

.integration/travis.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ if [ $(python -c "import sys; print(sys.version_info.major)") = "3" ] && [ "$TR
99
cd examples/python
1010
for test_file in ./*.py; do python $test_file; done
1111
cd ../..
12-
twine upload -r testpypi wheelhouse/* -u "cgal" -p "$CGALTestPyPiPassword" --non-interactive --skip-existing
13-
12+
if [ -n "$DO_UPLOAD" ]; then
13+
twine upload -r testpypi wheelhouse/* -u "cgal" -p "$CGALTestPyPiPassword" --non-interactive --skip-existing
14+
fi
15+
1416
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/ -DBUILD_PYTHON=OFF .
1517
make -j2 VERBOSE=1 && make install -j2 && make tests -j2 VERBOSE=1 && ctest -j2 --output-on-failure
1618
elif [ $(python -c "import sys; print(sys.version_info.major)") = "3" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
@@ -20,7 +22,9 @@ elif [ $(python -c "import sys; print(sys.version_info.major)") = "3" ] && [ "$
2022
cd ../..
2123
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/ -DBUILD_PYTHON=OFF .
2224
make -j2 VERBOSE=1 && make install -j2 && make tests -j2 VERBOSE=1 && ctest -j2 --output-on-failure
23-
twine upload -r testpypi fixed_wheel/* -u "cgal" -p "$CGALTestPyPiPassword" --non-interactive --skip-existing
25+
if [ -n "$DO_UPLOAD" ]; then
26+
twine upload -r testpypi fixed_wheel/* -u "cgal" -p "$CGALTestPyPiPassword" --non-interactive --skip-existing
27+
fi
2428
else
2529
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/ -DPython_FIND_VERSION_MAJOR=2 .
2630
make -j2 VERBOSE=1 && make install -j2 && make tests -j2 VERBOSE=1 && ctest -j2 --output-on-failure

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ env:
1818
- CGAL_PYTHON_EXAMPLES=examples/python
1919
- PYCODESTYLE_CONVENTIONS="--max-line-length=120"
2020
- secure: LJapS6f/ZojkerZ6me1RHnPC3QAqivtsM0F3pnp8QRcala4PRGn8BIG7CfSrWYEy1RmmniWCNzS5CHsP6qLrAKtYeTNSdbSomx0uhatwXVTlllcDsyAwenqCgtGXejJ4T0HmRi8meURPjhJ77UMmvpfL3vqqfFpW0hYZsDEd/sA=
21+
include:
22+
if: type = push
23+
env: DO_UPLOAD="TRUE"
2124
matrix:
2225
include:
2326
- os: osx
@@ -90,7 +93,7 @@ addons:
9093
- libgl1-mesa-dev
9194
- libtbb-dev
9295
before_install:
93-
- echo $PATH
96+
- echo $DO_UPLOAD
9497
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then source .integration/osx_utils.sh && get_macpython_environment
9598
$MB_PYTHON_VERSION; fi
9699
- python -m pip install --upgrade pip

0 commit comments

Comments
 (0)