Skip to content

fix env

fix env #3726

Workflow file for this run

name: Centos7 CI (push and/or release)
on:
release:
types: [created]
push:
branches:
- develop
- fix/csr-remix
schedule:
- cron: '21 2 * * *'
workflow_call:
inputs:
run-tests:
required: true
type: string
target_branch:
required: true
type: string
env:
GITHUB_TOKEN: ${{ github.token }}
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }}
IS_PUSH: ${{ github.event_name == 'push' }}
REF: ${{ inputs.target_branch =='' && github.ref_name || inputs.target_branch}}
jobs:
build:
name: Build
env:
ORTOOLSDIR: ${{ github.workspace }}/or-tools
runs-on: ubuntu-latest
container:
image: 'antaresrte/rte-antares:centos7-simulator-no-deps'
volumes:
- /node20217:/node20217:rw,rshared
- /node20217:/__e/node20:ro,rshared
steps:
- name: install nodejs20glibc2.17
if: always()
run: |
curl -LO https://unofficial-builds.nodejs.org/download/release/v20.17.0/node-v20.17.0-linux-x64-glibc-217.tar.xz
tar -xf node-v20.17.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
ldd /__e/node20/bin/node
- name: Upload bash (TODO REMOVE THIS)
uses: actions/upload-artifact@v4
with:
name: bash
path: /bin/bash
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ env.REF }}
- name: Install gcc 10
run: |
yum install -y centos-release-scl
yum install -y devtoolset-10-gcc*
- uses: ./.github/workflows/install-cmake-328
- name: Init submodule
run: |
git submodule update --init --remote src/antares-deps src/tests/resources/Antares_Simulator_Tests
- name: Download & extract precompiled deps at root
run: |
ANTARES_DEPS_VERSION=$(cut -d'"' -f4 antares-deps-version.json | grep -Ev '\{|\}')
cd /
wget https://github.com/AntaresSimulatorTeam/antares-deps/releases/download/v${ANTARES_DEPS_VERSION}/rte-antares-deps-centos7-Release.tar.gz
tar -xvf rte-antares-deps-centos7-Release.tar.gz
rm -rf rte-antares-deps-centos7-Release.tar.gz
- name: Config OR-Tools URL
run: |
echo "URL_ORTOOLS=https://github.com/rte-france/or-tools/releases/download/$(cat ortools_tag)/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV
- name: Download OR-Tools
id: ortools
run: |
mkdir -p ${{ env.ORTOOLSDIR }} && cd ${{ env.ORTOOLSDIR }}
wget -q -O ortools.zip ${{ env.URL_ORTOOLS }}
unzip -q ortools.zip
rm ortools.zip
- name: Install gh if needed
if: ${{ env.IS_RELEASE == 'true' }}
run: |
wget https://github.com/cli/cli/releases/download/v2.52.0/gh_2.52.0_linux_amd64.rpm
rpm -i gh_2.52.0_linux_amd64.rpm
gh --version
- name: Configure
run: |
source /opt/rh/devtoolset-10/enable
cmake -B _build -S src \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DDEPS_INSTALL_DIR=/rte-antares-deps-Release \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DBUILD_not_system=OFF \
-DBUILD_TOOLS=ON \
-DBUILD_UI=OFF \
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \
- name: Build
run: |
source /opt/rh/devtoolset-10/enable
source /opt/rh/rh-git227/enable
cmake --build _build --config Release -j$(nproc)
ccache -s
- name: Installer .rpm creation
run: |
cd _build
cpack -G RPM
- name: Solver archive creation
run: |
cd _build
cmake --install . --prefix install
pushd .
cd install/bin
tar czf ../../antares-solver_centos7.tar.gz antares-*-solver libsirius_solver.so
popd
rm -rf install
- name: Installer archive upload push
uses: actions/upload-artifact@v4
with:
name: solver-targz
path: _build/*.tar.gz
- name: Publish assets
if: ${{ env.IS_RELEASE == 'true' }}
env:
GITHUB_TOKEN: ${{ github.token }}
tag: ${{ github.event.inputs.release_tag }}
run: |
gh release upload "$tag" _build/*.tar.gz _build/*.rpm