Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into ci/cleanup_gtest
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 committed Oct 3, 2024
2 parents 3a08b36 + 314d28c commit 686be42
Show file tree
Hide file tree
Showing 108 changed files with 5,511 additions and 11,066 deletions.
187 changes: 152 additions & 35 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
with:
files: |
docker/centos7-system-deps
Expand All @@ -40,7 +40,7 @@ jobs:
workdir: docker
dockerfile: centos7-system-deps
cache: false
tags: latest,1.0.0
tags: 1.1.0

versions:
runs-on: ubuntu-latest
Expand All @@ -63,39 +63,32 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'


build:
runs-on: ubuntu-latest
needs: [ docker_publish, versions ]
container: 'antaresrte/xpansion-centos7'
strategy:
matrix:
xprs: [
# { value: XPRESS-ON, ref: 8.13a },
{ value: XPRESS-ON, ref: 9.2.5 },
#{ value: XPRESS-OFF }
]
container: 'antaresrte/xpansion-centos7:1.1.0'
env:
XPRESSDIR: ${{ github.workspace }}/xpress
XPRESS: ${{ github.workspace }}/xpress/bin
XPRS_LIB_Path: ${{ github.workspace }}/xpress/lib
XPRESSDIR_CONTAINER: ${GITHUB_WORKSPACE}/xpress
XPRESS_CONTAINER: ${GITHUB_WORKSPACE}/xpress/bin
XPRS_LIB_Path_CONTAINER: ${GITHUB_WORKSPACE}/xpress/lib
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools

outputs:
TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }}
SINGLE_FILE_NAME: ${{ steps.export_output.outputs.SINGLE_FILE_NAME }}

steps:
- run: |
source /opt/rh/devtoolset-10/enable
source /opt/rh/devtoolset-11/enable
echo $PATH >> $GITHUB_PATH
- name: Get release
if: github.event_name == 'release' && github.event.action == 'created'
id: get_release
uses: bruceadams/[email protected]


- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2-test-4/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV
- uses: actions/checkout@v3 #Keep at 3
with:
submodules: true
Expand All @@ -108,23 +101,15 @@ jobs:
with:
cmake-version: '3.28.x'

- name: Checkout xpressmp linux
uses: actions/checkout@v3 #keep v3
with:
token: ${{ secrets.AS_TOKEN }}
repository: rte-france/xpress-mp
path: ${{ env.XPRESSDIR }}
github-server-url: https://github.com
ref: ${{matrix.xprs.ref}}
if: matrix.xprs.value == 'XPRESS-ON'

- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
antares-version: ${{needs.versions.outputs.antares-version}}
os: centos7
os-full-name: CentOS-7.9.2009

ortools-url: ${{env.ORTOOLS_URL}}
ortools-dir: ${{env.ORTOOLS_DIR}}

- name: repo update
run: |
yum update
Expand All @@ -139,6 +124,19 @@ jobs:
pip3 install -r requirements-tests.txt
pip3 install -r requirements-ui.txt
- name: Set-up Xpress with pip for centos 7
shell: bash
run: |
export PATH=/root/miniconda3/condabin:$PATH
conda install -c fico-xpress "xpress>=9.2,<9.3"
XPRESS_DIR=/root/miniconda3/lib/python3.8/site-packages/xpress
echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV
echo "XPAUTH_PATH=$XPRESS_DIR/license/community-xpauth.xpr" >> $GITHUB_ENV
echo "Create symbolic link for XPRESS library file because it is missing in the Python installation"
ln -s $XPRESS_DIR/lib/libxprs.so.42 $XPRESS_DIR/lib/libxprs.so

- name: vcpkg install
run: |
git config --global safe.directory '*'
Expand All @@ -161,20 +159,28 @@ jobs:

- name: Configure
run: |
source /opt/rh/devtoolset-10/enable
source /opt/rh/devtoolset-11/enable
cmake -B _build -S . \
-DBUILD_TESTING=ON \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/deps;${{env.ORTOOLS_DIR}}/install" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=_install \
-DBUILD_UI=ON \
-DALLOW_RUN_AS_ROOT=ON \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: |
cmake --build _build --config Release -j$(nproc)
- name: Run cucumber on outer_loop tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/outer_loop_tests.feature"
mpi_path: ${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin

- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
Expand All @@ -187,9 +193,7 @@ jobs:
timeout-minutes: 120
shell: bash
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }}
export XPRESS=${{ env.XPRESS_CONTAINER }}
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux-release/tools/openmpi/bin/:$PATH
cd _build
ctest -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
Expand Down Expand Up @@ -262,6 +266,119 @@ jobs:
name: user-guide
path: ${{ steps.create-user-guide.outputs.pdf-path }}

build_running_image:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export
uses: docker/build-push-action@v6
with:
tags: centos:run
file: docker/centos7_test_run
outputs: type=docker,dest=/tmp/centos.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: centos
path: /tmp/centos.tar

test_assets:
runs-on: ubuntu-latest
needs: [ build, build_running_image ]
steps:
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: ${{needs.build.outputs.TGZ_NAME}}

- name: Download image
uses: actions/download-artifact@v4
with:
name: centos
path: /tmp

- name: Load image
run: |
docker load --input /tmp/centos.tar
- name: setup
run: |
tar --strip-components=1 -xzf ${{needs.build.outputs.TGZ_NAME}}
- uses: addnab/docker-run-action@v3
name: Run tests
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates --allow-run-as-root
- uses: addnab/docker-run-action@v3
name: run tests with 2 processes
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates -n 2 --allow-run-as-root
test_single_file_asset:
runs-on: ubuntu-latest
needs: [ build, build_running_image ]
steps:
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: ${{needs.build.outputs.SINGLE_FILE_NAME}}

- name: Download image
uses: actions/download-artifact@v4
with:
name: centos
path: /tmp

- name: Load image
run: |
docker load --input /tmp/centos.tar
- name: setup
run: |
tar --strip-components=1 -xzf ${{needs.build.outputs.SINGLE_FILE_NAME}}
- uses: addnab/docker-run-action@v3
name: Run tests
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates --allow-run-as-root
- uses: addnab/docker-run-action@v3
name: run tests with 2 processes
with:
image: centos:run
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
cd /work
./antares-xpansion-launcher -i examples/SmallTestFiveCandidates -n 2 --allow-run-as-root
release:
runs-on: ubuntu-latest
needs: [ build, userguide ]
Expand Down Expand Up @@ -295,4 +412,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} _build/${{needs.build.outputs.TGZ_NAME}}
gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} ${{needs.build.outputs.SINGLE_FILE_NAME}}
gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} ${{needs.build.outputs.SINGLE_FILE_NAME}}
Loading

0 comments on commit 686be42

Please sign in to comment.