GitHub Actions: Add Julia tests

pull/3/head
Alinson S. Xavier 5 years ago
parent 537e7f5764
commit 683b3c5893

@ -9,9 +9,10 @@ jobs:
run: | run: |
rm -rf ~/.conda/envs/miplearn-test rm -rf ~/.conda/envs/miplearn-test
yes | conda create --name miplearn-test python=3.6 yes | conda create --name miplearn-test python=3.6
JULIA_DEPOT_PATH=/home/axavier/.julia:/opt/julia-1.3.0/depot julia --project=src/julia -e 'using Pkg; Pkg.instantiate()'
(cd /opt/gurobi900/linux64 && ~/.conda/envs/miplearn-test/bin/python setup.py install) (cd /opt/gurobi900/linux64 && ~/.conda/envs/miplearn-test/bin/python setup.py install)
(cd /opt/cplex-12.8/cplex/python/3.6/x86-64_linux && ~/.conda/envs/miplearn-test/bin/python setup.py install) (cd /opt/cplex-12.8/cplex/python/3.6/x86-64_linux && ~/.conda/envs/miplearn-test/bin/python setup.py install)
~/.conda/envs/miplearn-test/bin/pip install -r src/python/requirements.txt ~/.conda/envs/miplearn-test/bin/pip install -r src/python/requirements.txt
make install-python install-julia PYTHON=~/.conda/envs/miplearn-test/bin/python
~/.conda/envs/miplearn-test/bin/pytest src/python ~/.conda/envs/miplearn-test/bin/pytest src/python
make test-julia

@ -1,15 +1,17 @@
PYTHON := python3 PYTHON := python3
PYTEST := pytest PYTEST := pytest
PIP := pip3 PIP := pip3
PYTEST_ARGS := -W ignore::DeprecationWarning -vv -x --log-level=DEBUG JULIA := julia
JULIA := julia --color=yes --project=src/julia
JULIA_SYSIMAGE := $(JULIA) --sysimage build/sysimage.so PYTEST_ARGS := -W ignore::DeprecationWarning -vv -x --log-level=DEBUG
JULIA_ARGS := --color=yes --project=src/julia
JULIA_SYSIMAGE_ARGS := $(JULIA_ARGS) --sysimage build/sysimage.so
all: docs test all: docs test
build/sysimage.so: src/julia/Manifest.toml src/julia/Project.toml build/sysimage.so: src/julia/Manifest.toml src/julia/Project.toml
mkdir -p build mkdir -p build
$(JULIA) src/julia/sysimage.jl $(JULIA) $(JULIA_ARGS) src/julia/sysimage.jl
develop: develop:
cd src/python && $(PYTHON) setup.py develop cd src/python && $(PYTHON) setup.py develop
@ -23,7 +25,7 @@ install-python:
cd src/python && $(PYTHON) setup.py install cd src/python && $(PYTHON) setup.py install
install-julia: install-julia:
$(JULIA) -e "using Pkg; Pkg.instantiate()" $(JULIA) $(JULIA_ARGS) src/julia/setup.jl `which $(PYTHON)`
uninstall: uninstall:
$(PIP) uninstall miplearn $(PIP) uninstall miplearn
@ -37,6 +39,6 @@ test-python-watch:
cd src/python && pytest-watch -- $(PYTEST_ARGS) cd src/python && pytest-watch -- $(PYTEST_ARGS)
test-julia: build/sysimage.so test-julia: build/sysimage.so
$(JULIA_SYSIMAGE) src/julia/test/runtests.jl $(JULIA) $(JULIA_SYSIMAGE_ARGS) src/julia/test/runtests.jl
.PHONY: test test-python test-julia test-watch docs install .PHONY: test test-python test-julia test-watch docs install

@ -0,0 +1,7 @@
ENV["PYTHON"] = ARGS[1]
using Pkg
Pkg.instantiate()
Pkg.build("CPLEX")
Pkg.build("Gurobi")
Pkg.build("PyCall")

@ -1,10 +1,13 @@
docopt docopt
matplotlib matplotlib
mkdocs
mkdocs-cinder
networkx networkx
numpy numpy
p_tqdm p_tqdm
pandas pandas
pyomo pyomo
pytest
python-markdown-math python-markdown-math
seaborn seaborn
sklearn sklearn

@ -10,15 +10,11 @@ setup(
install_requires=[ install_requires=[
'docopt', 'docopt',
'matplotlib', 'matplotlib',
'mkdocs',
'mkdocs-cinder',
'networkx', 'networkx',
'numpy', 'numpy',
'pandas', 'pandas',
'p_tqdm', 'p_tqdm',
'pyomo', 'pyomo',
'pytest',
'pytest-watch',
'python-markdown-math', 'python-markdown-math',
'seaborn', 'seaborn',
'sklearn', 'sklearn',

Loading…
Cancel
Save