Skip to content

Commit

Permalink
try use dockerfile for centos.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sgatto committed Jul 18, 2024
1 parent 605f5c0 commit eda76d2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 99 deletions.
111 changes: 16 additions & 95 deletions .github/workflows/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,15 @@ env:
jobs:

build:
name: shrd=${{ matrix.shared }} sirius=${{ matrix.sirius }} extras=${{ matrix.extras }} java=${{ matrix.java }} dotnet=${{ matrix.dotnet }} python=${{ matrix.python }}-${{ matrix.python-version }}
name: shrd=${{ matrix.shared }} sirius=${{ matrix.sirius }}
runs-on: ubuntu-latest
container: 'centos:centos7'
env:
SIRIUS_RELEASE_TAG: antares-integration-v1.4
XPRESS_INSTALL_DIR: xpressmp
strategy:
fail-fast: false
matrix:
sirius: [ON, OFF]
shared: [ON, OFF]
extras: [OFF]
include:
- extras: OFF
python: OFF
java: OFF
dotnet: OFF
- sirius: ON
shared: OFF
extras: OFF
python: OFF
java: OFF
dotnet: OFF

steps:
- name: set name variables
Expand All @@ -67,26 +53,6 @@ jobs:
id: branch-names
uses: tj-actions/branch-names@v8

- name: Install requirements (yum)
run: |
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum install -y epel-release
yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils python3
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum install -y devtoolset-11
python3 -m pip install --upgrade pip
python3 -m pip install dataclasses
- name: Setup cmake
run : |
wget --no-verbose "https://devin-depot.rte-france.com/repository/cmake/v3.27/cmake-3.27.0-linux-x86_64.sh"
chmod a+x cmake-3.*-linux-x86_64.sh
./cmake-3.*-linux-x86_64.sh --prefix=/usr/local/ --skip-license
rm cmake-3.*-linux-x86_64.sh
- name: Checkout OR-Tools
if: ${{ env.RELEASE_CREATED == 'false' }}
run: |
Expand All @@ -95,7 +61,7 @@ jobs:
- name: Checkout OR-Tools
if: ${{ env.RELEASE_CREATED == 'true' }}
run: |
git clone $GITHUB_SERVER_URL/google/or-tools.git -b 'v9.10' .
git clone $GITHUB_SERVER_URL/google/or-tools.git -b 'stable' .
- name: Checkout this repository
run: |
Expand All @@ -106,67 +72,22 @@ jobs:
cp -r patch/* .
python3 patch.py
- name: Set-up Xpress from wheel
- name: Build inside docker
run: |
python3 -m pip install --upgrade pip
mkdir xpress
cd xpress
python3 -m pip download --only-binary=:all: --python-version 310 "xpress>=9.2,<9.3"
unzip xpr*.whl
XPRESS_DIR=$PWD/xpress
echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV
echo "XPAUTH_PATH=$XPRESS_DIR/license/community-xpauth.xpr" >> $GITHUB_ENV
ln -s $XPRESS_DIR/lib/libxprs.so.42 $XPRESS_DIR/lib/libxprs.so
- name: Download Sirius
if : ${{ matrix.sirius == 'ON' }}
docker build \
--target build \
-t centos:shared-${{ matrix.shared }}-sirius-${{ matrix.sirius }} \
--build-arg="SIRIUS=${{ matrix.sirius }}" \
--build-arg="SHARED=${{ matrix.shared }}" \
--build-arg="SIRIUS_RELEASE_TAG=${{ env.SIRIUS_RELEASE_TAG }}" \
-f docker/centos.dockerfile .
- name: retrieve install from docker
run: |
zipfile=centos-7_sirius-solver.zip
wget https://github.com/rte-france/sirius-solver/releases/download/${{ env.SIRIUS_RELEASE_TAG }}/$zipfile
unzip $zipfile
mv centos-7_sirius-solver-install sirius_install
echo "LD_LIBRARY_PATH=$PWD/sirius_install/lib" >> $GITHUB_ENV
echo "SIRIUS_CMAKE_DIR=$PWD/sirius_install/cmake" >> $GITHUB_ENV
- name: Configure OR-Tools
run: |
source /opt/rh/devtoolset-11/enable
cmake --version
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
-DBUILD_PYTHON=${{ matrix.python }} \
-DBUILD_JAVA=${{ matrix.java }} \
-DBUILD_DOTNET=${{ matrix.dotnet }} \
-DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || 'ON' }} \
-DBUILD_DEPS=ON \
-DUSE_SIRIUS=${{ matrix.sirius }} \
-Dsirius_solver_DIR="${{ env.SIRIUS_CMAKE_DIR }}" \
-DCMAKE_INSTALL_PREFIX="build/install" \
-DBUILD_SAMPLES=OFF \
-DBUILD_FLATZINC=OFF
- name: Build OR-Tools Linux
run: |
source /opt/rh/devtoolset-11/enable
cmake --build build --config Release --target all install -j4
- name: run tests not xpress
if: ${{ matrix.shared == 'ON' }}
run: |
cd build
ctest -C Release --output-on-failure -E "_xpress"
- name: run tests xpress
run: |
cd build
ctest -V -C Release --output-on-failure -R "_xpress"
- name: run tests sirius
run: |
cd build
ctest -V -C Release --output-on-failure -R "sirius"
container_id=\$(docker create centos:shared-${{ matrix.shared }}-sirius-${{ matrix.sirius }})
rm -rf ./install
docker cp \$container_id:/home/project/build/install ./install
docker rm \$container_id
- name: Prepare OR-Tools install
id: or-install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'v9.10'
ref: 'stable'

- name: Checkout this repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'v9.10'
ref: 'stable'

- name: Checkout this repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'v9.10'
ref: 'stable'

- name: Checkout this repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: google/or-tools
ref: 'v9.10'
ref: 'stable'

- name: Checkout this repository
uses: actions/checkout@v4
Expand Down

0 comments on commit eda76d2

Please sign in to comment.