mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
GitHub Actions: Add Julia tests
This commit is contained in:
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
@@ -9,9 +9,10 @@ jobs:
|
||||
run: |
|
||||
rm -rf ~/.conda/envs/miplearn-test
|
||||
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/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
|
||||
make install-python install-julia PYTHON=~/.conda/envs/miplearn-test/bin/python
|
||||
~/.conda/envs/miplearn-test/bin/pytest src/python
|
||||
make test-julia
|
||||
|
||||
|
||||
16
Makefile
16
Makefile
@@ -1,15 +1,17 @@
|
||||
PYTHON := python3
|
||||
PYTEST := pytest
|
||||
PIP := pip3
|
||||
PYTEST_ARGS := -W ignore::DeprecationWarning -vv -x --log-level=DEBUG
|
||||
JULIA := julia --color=yes --project=src/julia
|
||||
JULIA_SYSIMAGE := $(JULIA) --sysimage build/sysimage.so
|
||||
PIP := pip3
|
||||
JULIA := julia
|
||||
|
||||
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
|
||||
|
||||
build/sysimage.so: src/julia/Manifest.toml src/julia/Project.toml
|
||||
mkdir -p build
|
||||
$(JULIA) src/julia/sysimage.jl
|
||||
$(JULIA) $(JULIA_ARGS) src/julia/sysimage.jl
|
||||
|
||||
develop:
|
||||
cd src/python && $(PYTHON) setup.py develop
|
||||
@@ -23,7 +25,7 @@ install-python:
|
||||
cd src/python && $(PYTHON) setup.py install
|
||||
|
||||
install-julia:
|
||||
$(JULIA) -e "using Pkg; Pkg.instantiate()"
|
||||
$(JULIA) $(JULIA_ARGS) src/julia/setup.jl `which $(PYTHON)`
|
||||
|
||||
uninstall:
|
||||
$(PIP) uninstall miplearn
|
||||
@@ -37,6 +39,6 @@ test-python-watch:
|
||||
cd src/python && pytest-watch -- $(PYTEST_ARGS)
|
||||
|
||||
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
|
||||
|
||||
7
src/julia/setup.jl
Normal file
7
src/julia/setup.jl
Normal file
@@ -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
|
||||
matplotlib
|
||||
mkdocs
|
||||
mkdocs-cinder
|
||||
networkx
|
||||
numpy
|
||||
p_tqdm
|
||||
pandas
|
||||
pyomo
|
||||
pytest
|
||||
python-markdown-math
|
||||
seaborn
|
||||
sklearn
|
||||
|
||||
@@ -10,15 +10,11 @@ setup(
|
||||
install_requires=[
|
||||
'docopt',
|
||||
'matplotlib',
|
||||
'mkdocs',
|
||||
'mkdocs-cinder',
|
||||
'networkx',
|
||||
'numpy',
|
||||
'pandas',
|
||||
'p_tqdm',
|
||||
'pyomo',
|
||||
'pytest',
|
||||
'pytest-watch',
|
||||
'python-markdown-math',
|
||||
'seaborn',
|
||||
'sklearn',
|
||||
|
||||
Reference in New Issue
Block a user