-
Notifications
You must be signed in to change notification settings - Fork 8
185 lines (162 loc) · 6.48 KB
/
ubuntu.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
name: Ubuntu
on:
push:
branches: [main, release-*, scorpion]
pull_request:
branches: [main, release-*, scorpion]
# Some notes on file paths: the working directory is $GITHUB_WORKSPACE,
# which equals /home/runner/work/my-repo-name/my-repo-name. The code is
# checked out to $GITHUB_WORKSPACE as well. We put all libraries under
# /home/runner/lib.
jobs:
compile:
name: Compile planner
timeout-minutes: 60
runs-on: ${{ matrix.version.ubuntu }}
strategy:
matrix:
version:
- {ubuntu: 'ubuntu-20.04', python: '3.8', cc: gcc-10, cxx: g++-10, run_tox_tests: true}
- {ubuntu: 'ubuntu-20.04', python: '3.8', cc: clang-12, cxx: clang++-12, run_tox_tests: false}
- {ubuntu: 'ubuntu-22.04', python: '3.10', cc: gcc-11, cxx: g++-11, run_tox_tests: false}
- {ubuntu: 'ubuntu-22.04', python: '3.10', cc: gcc-12, cxx: g++-12, run_tox_tests: true}
- {ubuntu: 'ubuntu-22.04', python: '3.10', cc: clang-14, cxx: clang++-14, run_tox_tests: false}
env:
CC: ${{ matrix.version.cc }}
CXX: ${{ matrix.version.cxx }}
CPLEX_URL: ${{ secrets.CPLEX2211_LINUX_URL }}
cplex_DIR: /home/runner/lib/ibm/ILOG/CPLEX_Studio2211/cplex
CPLEX_LIB: /home/runner/lib/ibm/ILOG/CPLEX_Studio2211/cplex/bin/x86-64_linux/libcplex2211.so
soplex_DIR: /home/runner/lib/soplex-6.0.3x
SOPLEX_LIB: /home/runner/lib/soplex-6.0.3x/lib/
SOPLEX_INCLUDE: /home/runner/lib/soplex-6.0.3x/include/
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version.python }}
- name: Install dependencies
run: |
sudo apt-get -y install zlib1g-dev libgmp3-dev ${{ matrix.version.cc }}
mkdir /home/runner/lib
# In 22.04 g++-12 is not automatically installed when gcc-12 gets
# installed, so we do it separately. We do not use an unconditional
# install for any value of cxx because there is no separate package for
# clang++.
- name: Install CXX
if: startsWith(matrix.version.cxx, 'g++-')
run: |
sudo apt-get -y install ${{ matrix.version.cxx }}
# TODO: Remove once issue with Ubuntu 22.04 and clang++-14 is resolved.
- name: Work around https://github.com/actions/runner-images/issues/8659
if: matrix.version.cxx == 'clang++-14'
run: |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.35-* libc6-dev=2.35-* libstdc++6=12.3.0-* libgcc-s1=12.3.0-*
# Only install CPLEX if its URL/secret is set.
- name: Install CPLEX
if: ${{ env.CPLEX_URL != 0 }}
run: |
# We redirect output of wget to hide the secret URLs.
wget -O cplex_installer $CPLEX_URL &> /dev/null
chmod +x cplex_installer
./cplex_installer -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR="$(dirname "${cplex_DIR}")" -i silent
rm cplex_installer
# Always install SoPlex
- name: Install SoPlex
run: |
git clone https://github.com/scipopt/soplex.git
cd soplex
git checkout a5df0814d67812c13a00f06eec507b4d071fb862
cd ..
cmake -S soplex -B build
cmake --build build
cmake --install build --prefix "${soplex_DIR}"
rm -rf soplex build
- name: Compile planner
run: |
export CXXFLAGS="-Werror" # Treat compilation warnings as errors.
./build.py --debug
./build.py
- name: Archive required files
# We only run tests on one compiler version per Ubuntu version, so we
# only need to archive that one.
if: ${{ matrix.version.run_tox_tests }}
run: |
files_to_archive="fast-downward.py driver misc builds/debug/bin/ \
builds/release/bin/ ${SOPLEX_LIB} ${SOPLEX_INCLUDE}"
if [[ ! -z "${CPLEX_URL}" ]]; then
files_to_archive="${files_to_archive} ${CPLEX_LIB}"
fi
tar cfz archive.tar.gz -C "/home/runner" $(realpath --relative-to="/home/runner" $files_to_archive)
- name: Upload archive
if: ${{ matrix.version.run_tox_tests }}
uses: actions/upload-artifact@v3
with:
name: compiled-planner-${{ matrix.version.ubuntu }}
path: archive.tar.gz
retention-days: 1
run_tox_tests:
name: Test planner
runs-on: ${{ matrix.version.ubuntu }}
needs: compile # TODO: this only depends on the compile step with the gcc version we test
strategy:
matrix:
version:
- {ubuntu: ubuntu-20.04, python: '3.8'}
- {ubuntu: ubuntu-22.04, python: '3.10'}
env:
CPLEX_URL: ${{ secrets.CPLEX2211_LINUX_URL }}
steps:
- name: Download archive
uses: actions/download-artifact@v3
with:
name: compiled-planner-${{ matrix.version.ubuntu }}
- name: Delete artifact
uses: geekyeggo/delete-artifact@v2
with:
name: compiled-planner-${{ matrix.version.ubuntu }}
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version.python }}
- name: Install dependencies
run: |
pip3 install tox
sudo apt-get -y install zlib1g-dev libgmp3-dev gcc flex bison
# NOTE: VAL does not compile with clang-12.
- name: Install VAL
run: |
git clone https://github.com/KCL-Planning/VAL.git
cd VAL
git checkout a5565396007eee73ac36527fbf904142b3077c74
make clean # Remove old build artifacts and binaries.
sed -i 's/-Werror //g' Makefile # Ignore warnings.
make -j2
mv validate ../
cd ../
rm -rf VAL
echo `pwd` >> $GITHUB_PATH # Add VAL to path of subsequent steps.
- name: Extract archive
# We need to make sure that library paths are the same as
# during compilation.
run: |
tar xfz archive.tar.gz -C "/home/runner"
- name: Run driver, translator and search tests
run: |
cd misc/
tox -e driver,translator,search,autodoc
- name: Run CPLEX tests
if: ${{ env.CPLEX_URL != 0 }}
run: |
cd misc/
tox -e cplex
- name: Run SoPlex tests
run: |
cd misc/
tox -e soplex
...