Skip to content

Commit

Permalink
Merge branch 'develop' into feature/pre-check-hydraulic-inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Jun 10, 2024
2 parents 3eb714a + a121c75 commit bd72fb1
Show file tree
Hide file tree
Showing 99 changed files with 1,829 additions and 1,784 deletions.
67 changes: 43 additions & 24 deletions .github/workflows/centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches:
- develop
- dependabot/*

schedule:
- cron: '21 2 * * *'
workflow_call:
Expand Down Expand Up @@ -46,19 +45,32 @@ jobs:
yum install -y centos-release-scl
yum install -y devtoolset-10-gcc*
- uses: ./.github/workflows/install-cmake-328
- name: Install cmake 3.28
run: pip3 install cmake==3.28.4

- name: Init submodule
- name: Install VCPKG
# Note: we need to use environment variables instead of workflow variables
# because github messes up path variables when running in container,
# see https://github.com/actions/runner/issues/2058
run: |
git submodule update --init --remote src/antares-deps src/tests/resources/Antares_Simulator_Tests
git submodule update --init vcpkg && ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV
echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV
echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/vcpkg_cache,readwrite" >> $GITHUB_ENV
- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
# Note: we are stuck with v3, because v4 is not compatible with oracle8 image
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-centos7-

- name: Download & extract precompiled deps at root
- name: Init submodule
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
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests
- name: Config OR-Tools URL
run: |
Expand All @@ -80,20 +92,21 @@ jobs:
dnf -y config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
dnf -y install gh
- 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 \
source /opt/rh/devtoolset-10/enable
source /opt/rh/rh-git227/enable
cmake -B _build -S src \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DBUILD_TOOLS=ON \
-DBUILD_UI=OFF \
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \
- name: Build
run: |
Expand Down Expand Up @@ -139,5 +152,11 @@ jobs:
tag: ${{ github.event.inputs.release_tag }}
run: |
gh release upload "$tag" _build/*.tar.gz _build/*.rpm
- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
uses: actions/cache/save@v3
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "Download extract .tgz precompiled libraries"
description: "Download and extract .tgz precompiled libraries from antares-deps and antares-simulator repository"
inputs:
antares-deps-version:
description: 'antares-deps version'
required: true
os:
description: 'operational system used for github action'
required: true
Expand All @@ -21,12 +18,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Download & extract antares-deps
shell: bash
run: |
wget https://github.com/AntaresSimulatorTeam/antares-deps/releases/download/v${{inputs.antares-deps-version}}/rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.tar.gz
tar -xvf rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.tar.gz
rm -rf rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.tar.gz

- name: Download & extract OR-Tools
shell: bash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "Download extract .zip precompiled libraries"
description: "Download and extract .zip precompiled libraries from antares-deps and antares-simulator repository"
inputs:
antares-deps-version:
description: 'antares-deps version'
required: true
os:
description: 'operational system used for github action'
required: true
Expand All @@ -20,15 +17,7 @@ inputs:

runs:
using: "composite"
steps:
- name: Download & extract antares-deps
shell: bash
run: |
wget https://github.com/AntaresSimulatorTeam/antares-deps/releases/download/v${{inputs.antares-deps-version}}/rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.zip
unzip rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.zip
rm -rf rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.zip
echo "${GITHUB_WORKSPACE}/rte-antares-deps-Release/bin" >> $GITHUB_PATH
steps:
- name: Download & extract OR-Tools
shell: bash
run: |
Expand Down
52 changes: 40 additions & 12 deletions .github/workflows/oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ env:
IS_PUSH: ${{ github.event_name == 'push' }}
REF: ${{ inputs.target_branch =='' && github.ref_name || inputs.target_branch}}


jobs:

build:
Expand All @@ -50,7 +49,28 @@ jobs:
- name: Checkout
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ env.REF }} .
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ env.REF }} .
git config --global safe.directory '*'
- name: Install VCPKG
# Note: we need to use environment variables instead of workflow variables
# because github messes up path variables when running in container,
# see https://github.com/actions/runner/issues/2058
run: |
git submodule update --init vcpkg && ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV
echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV
echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/vcpkg_cache,readwrite" >> $GITHUB_ENV
- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
# Note: we are stuck with v3, because v4 is not compatible with oracle8 image
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-oracle8-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-oracle8-

- name: Config OR-Tools URL
run: |
Expand All @@ -65,9 +85,7 @@ jobs:
rm ortools.zip
- name: Init submodule
run: |
git config --global safe.directory '*'
git submodule update --init --remote src/antares-deps src/tests/resources/Antares_Simulator_Tests
run: git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests

- name: Install dependencies
run: |
Expand All @@ -82,13 +100,15 @@ jobs:
- name: Configure
run: |
source /opt/rh/gcc-toolset-11/enable
cmake -B _build -S src \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DBUILD_TOOLS=ON \
-DBUILD_UI=OFF \
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLS_DIR }}/install
source /opt/rh/gcc-toolset-11/enable
cmake -B _build -S src \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DBUILD_TOOLS=ON \
-DBUILD_UI=OFF \
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLS_DIR }}/install
- name: Build
run: |
Expand Down Expand Up @@ -138,3 +158,11 @@ jobs:
tag: ${{ github.event.inputs.release_tag }}
run: |
gh release upload "$tag" _build/*.tar.gz _build/*.rpm
- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
uses: actions/cache/save@v3
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-oracle8-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
35 changes: 24 additions & 11 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,26 @@ jobs:
env:
SONAR_SERVER_URL: "https://sonarcloud.io"
ORTOOLS_DIR: ${{ github.workspace }}/or-tools
# Caching strategy of VCPKG dependencies
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install VCPKG
run: git submodule update --init vcpkg && ./vcpkg/bootstrap-vcpkg.sh -disableMetrics

- name: Restore vcpkg binary dir from cache
id: cache-vcpkg-binary
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-cache-ubuntu-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-ubuntu-

- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/$(cat ortools_tag)/ortools_cxx_ubuntu-20.04_static_sirius.zip" >> $GITHUB_ENV
Expand All @@ -40,17 +54,9 @@ jobs:
sudo apt-get install libboost-test-dev
sudo apt-get install g++-10 gcc-10
- name: Read antares-deps version
id: antares-deps-version
uses: notiz-dev/github-action-json-property@release
with:
path: 'antares-deps-version.json'
prop_path: 'antares_deps_version'

- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
antares-deps-version: ${{steps.antares-deps-version.outputs.prop}}
os: ${{matrix.os}}
buildtype: Debug
ortools-url: ${{env.ORTOOLS_URL}}
Expand All @@ -71,7 +77,6 @@ jobs:
- name: Init submodule
run: |
git submodule update --init src/antares-deps
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests
- name: Configure
Expand All @@ -81,13 +86,13 @@ jobs:
-DCMAKE_C_COMPILER=/usr/bin/gcc-10 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-DDEPS_INSTALL_DIR=./rte-antares-deps-Debug \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCODE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="../install;${{ env.ORTOOLS_DIR }}/install" \
-DBUILD_TESTING=ON \
-DMZ_CODE_COVERAGE=ON \
-DBUILD_not_system=OFF \
-DPython3_EXECUTABLE='${{ steps.setup-python.outputs.python-path }}'
- name: Build
Expand All @@ -109,3 +114,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}"

- name: Cache vcpkg binary dir
if: always()
id: save-cache-vcpkg-binary
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-cache-ubuntu-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
Loading

0 comments on commit bd72fb1

Please sign in to comment.