Skip to content
name: Centos7 CI (build dependencies)
on:
push:
branches:
- main
- develop
- release/*
- ci/*
- dependabot/*
jobs:
docker_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
docker/centos7-system-deps
- name: Docker file push
id: docker_push
if: steps.changed-files.outputs.any_changed == 'true'
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: antaresrte/xpansion-centos7
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: docker
dockerfile: centos7-system-deps
cache: false
tags: latest,1.0.0
versions:
runs-on: ubuntu-latest
outputs:
antares-version: ${{steps.antares-version.outputs.result}}
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}}
antares-deps-version: ${{steps.antares-deps-version.outputs.result}}
steps:
- uses: actions/checkout@v4
- name: Read antares-solver version
id: antares-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_version'
- name: Read antares-xpansion version
id: antares-xpansion-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_xpansion_version'
- name: Read antares-deps version
id: antares-deps-version
uses: ./.github/actions/read-json-value
with:
path: 'antares-version.json'
key: 'antares_deps_version'
build:
runs-on: ubuntu-latest
needs: [ docker_publish, versions ]
container: 'antaresrte/xpansion-centos7'
steps:
- id: branch-name
uses: tj-actions/branch-names@v8
- uses: actions/checkout@v3 #keep v3
with:
submodules: true
- run: |
source /opt/rh/devtoolset-10/enable
echo $PATH >> $GITHUB_PATH
- name: Install dependencies
run: |
pip3 install wheel #Does not work in requirements
pip3 install -r requirements-tests.txt
- run: |
yum install -y nodejs
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.28.x'
- name: Compile tbb
uses: ./.github/workflows/compile-tbb
- name: Restore vcpkg and its artifacts.
uses: actions/cache@v3
with:
# The first path is the location of vcpkg (it contains the vcpkg executable and data files).
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
path: |
${{ env.VCPKG_ROOT }}
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
# The key is composed in a way that it gets properly invalidated: this must happen whenever vcpkg's Git commit id changes, or the list of packages changes. In this case a cache miss must happen and a new entry with a new key with be pushed to GitHub the cache service.
# The key includes: hash of the vcpkg.json file, the hash of the vcpkg Git commit id, and the used vcpkg's triplet. The vcpkg's commit id would suffice, but computing an hash out it does not harm.
# Note: given a key, the cache content is immutable. If a cache entry has been created improperly, in order the recreate the right content the key must be changed as well, and it must be brand new (i.e. not existing already).
key: |
${{ hashFiles( 'vcpkg.json' ) }}-${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}-${{ matrix.triplet }}
- name: vcpkg install
run: |
pushd vcpkg
git fetch --unshallow
./bootstrap-vcpkg.sh
- name: Configure
run: |
cmake -B _build -S . \
-DDEPS_INSTALL_DIR=rte-antares-deps-Release \
-DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON -DALLOW_RUN_AS_ROOT=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: |
cmake --build _build --config Release -j$(nproc)
cd _build
cmake --install .
- name: Running unit tests
run: |
export PATH=${GITHUB_WORKSPACE}/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
cd _build
ctest -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
- name: .tar.gz creation
run: |
cd _build
cpack -G TGZ
- id: create-single-file
name: Single file .tar.gz creation
uses: ./.github/workflows/single-file-creation-tgz
with:
antares-xpansion-version: ${{needs.version.outputs.antares-xpansion-version}}