-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 3.21 KB
/
run-tests.yml
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
# This file is for running tests that don't actually execute Dapper (so we don't need to install Dapper dependencies)
name: Run Tests
on:
push:
branches: [ development, release ]
pull_request:
branches: [ development, release ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Dapper/ipopt Setup!!
- name: Set Up Environment
run: |
echo "LD_LIBRARY_PATH=/home/runner/work/Dapper/Dapper/ipopt_dist:/home/runner/work/Dapper/Dapper/ipopt_dist/lib:/usr/lib/coinbrew/ipopt:/usr/lib/coinbrew/ipopt/lib:/usr/lib/x86_64-linux-gnu/" >> $GITHUB_ENV
echo "PATH=$PATH:/home/runner/work/Dapper/Dapper/ipopt_dist:/home/runner/work/Dapper/Dapper/ipopt_dist/bin:/usr/lib/coinbrew/ipopt:/usr/lib/coinbrew/ipopt/bin:/usr/lib/x86_64-linux-gnu/" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/runner/work/Dapper/Dapper/ipopt_dist:/home/runner/work/Dapper/Dapper/ipopt_dist/lib:/usr/lib/coinbrew/ipopt:/usr/lib/x86_64-linux-gnu/" >> $GITHUB_ENV
- name: Check Environment
run: |
echo "$PATH"
echo "$LD_LIBRARY_PATH"
echo "$PKG_CONFIG_PATH"
- name: Install ipopt system requirements
run: |
# install the requirements for ipopt
sudo apt-get install gcc g++ gfortran git patch wget pkg-config liblapack-dev libmetis-dev build-essential python3-dev
# apparently ipopt wants glpk header files for compilation, but I think we'll also want this for solving anyway
sudo apt-get install glpk-utils libglpk-dev
- name: Cache Coinbrew paths
uses: actions/cache@v2
id: coinbrewcache
with:
path: |
~/coinbrew
key: ${{ runner.os }}-${{ matrix.python-version }}-coinbrew
- name: Get CoinBrew # we need it to install ipopt - the prebuilt packages wouldn't get recognized by pyomo
if: steps.coinbrewcache.outputs.cache-hit != 'true'
run: |
wget -O ~/coinbrew https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew
chmod u+x ~/coinbrew
- name: CoinBrew install ipopt (by compiling)
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo ~/coinbrew fetch Ipopt --no-prompt
sudo ~/coinbrew build Ipopt --prefix=/usr/lib/coinbrew/ipopt --test --no-prompt --verbosity=3
sudo ~/coinbrew install Ipopt --no-prompt
sudo rm -fr ./build
sudo mv ./dist ./ipopt_dist
# Back to Waterspout
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Get Dapper from S3
run: |
python -m pip install requests
python utils/get_dapper.py
- name: Django Setup # make sure local_settings.py exists
run: |
cp Waterspout/local_settings_template.py Waterspout/local_settings.py
cp Waterspout/databases_template.py Waterspout/databases.py
- name: Run Django Tests
run: |
python manage.py test