Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/develop' into fix/overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
OMNES Florian committed Sep 12, 2024
2 parents b01a028 + 775224e commit 53f4417
Show file tree
Hide file tree
Showing 618 changed files with 17,290 additions and 8,878 deletions.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/support_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Request for support
about: Ask any question
title: ''
labels: help wanted

---

**Your identity**
Your name, company, why you are interested in Antares-Simulator...
Any information that can help us understand the context of your request!

**Question**
Your question, remark...
100 changes: 60 additions & 40 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 All @@ -24,6 +23,7 @@ env:
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }}
IS_PUSH: ${{ github.event_name == 'push' }}
REF: ${{ inputs.target_branch =='' && github.ref_name || inputs.target_branch}}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:

Expand All @@ -43,26 +43,50 @@ jobs:
- name: Install gcc 10
run: |
# update mirrors, official centos7 is deprecated
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 update -y
# not a typo, centos-release-scl is needed to install devtoolset-10 but introduce deprecated mirror
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 centos-release-scl
yum install -y devtoolset-10-gcc*
yum install -y devtoolset-11-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: |
echo "URL_ORTOOLS=https://github.com/rte-france/or-tools/releases/download/$(cat ortools_tag)/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV
echo "URL_ORTOOLS=https://github.com/rte-france/or-tools-rte/releases/download/$(cat ortools_tag)/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV
- name: Download OR-Tools
id: ortools
Expand All @@ -75,29 +99,29 @@ jobs:
- name: Install gh if needed
if: ${{ env.IS_RELEASE == 'true' }}
run: |
yum -y install dnf
dnf -y install 'dnf-command(config-manager)'
dnf -y config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
dnf -y install gh
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 \
source /opt/rh/devtoolset-11/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: |
source /opt/rh/devtoolset-10/enable
source /opt/rh/devtoolset-11/enable
source /opt/rh/rh-git227/enable
cmake --build _build --config Release -j$(nproc)
ccache -s
Expand All @@ -122,16 +146,6 @@ jobs:
cd _build
cpack -G TGZ
- name: Installer TGZ push
uses: actions/upload-artifact@v3
with:
path: _build/*.tar.gz

- name: Installer RPM push
uses: actions/upload-artifact@v3
with:
path: _build/*.rpm

- name: Publish assets
if: ${{ env.IS_RELEASE == 'true' }}
env:
Expand All @@ -140,4 +154,10 @@ jobs:
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') }}
31 changes: 31 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check cpp formatting using clang 18.1.3

on:
pull_request:

jobs:
build:
name: clang-format

runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Print version
run: clang-format --version

- name: clang-format
run: cd src && ./format-code.sh

- name: git diff
run: |
DIFF=`git status --porcelain`
if [[ $DIFF ]]; then
echo "The following files are not well formatted, please make sure to use clang-format 18.1.3"
echo "$DIFF"
exit 1
else
echo "Code is well formatted, congrats !"
fi
23 changes: 23 additions & 0 deletions .github/workflows/cucumber-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Run cucumber tests"
description: "Run cucumber tests"
inputs:
feature:
description: 'Feature file or folder to run (default runs all features in "features" folder)'
required: false
default: 'features'
tags:
description: 'Tags to run (default skips tests marked @flaky)'
required: false
default: '~@flaky'
runs:
using: "composite"
steps:
- name: Install Python requirements
shell: bash
run: python3 -m pip install -r src/tests/cucumber/requirements.txt

- name: Run tests
shell: bash
run: |
cd src/tests/cucumber
behave --tags ${{ inputs.tags }} ${{ inputs.feature }}
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
4 changes: 2 additions & 2 deletions .github/workflows/install-cmake-328/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Install cmake 3.28 using devtoolset 10"
name: "Install cmake 3.28 using devtoolset 10 if possible"
description: "Download and install system wide cmake 3.28"

runs:
Expand All @@ -7,7 +7,7 @@ runs:
- name: Build cmake
shell: bash
run: |
source /opt/rh/devtoolset-10/enable
source /opt/rh/devtoolset-10/enable || true # Ignore error if devtoolset-10 is not available
yum -y install openssl-devel
wget https://github.com/Kitware/CMake/releases/download/v3.28.2/cmake-3.28.2.tar.gz
tar -xvf cmake-3.28.2.tar.gz
Expand Down
59 changes: 44 additions & 15 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,11 +49,31 @@ 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
uses: actions/cache/restore@v4
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: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools/releases/download/$(cat ortools_tag)/ortools_cxx_oraclelinux-8_static_sirius.zip" >> $GITHUB_ENV
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/$(cat ortools_tag)/ortools_cxx_oraclelinux-8_static_sirius.zip" >> $GITHUB_ENV
- name: Download & extract OR-Tools
run: |
Expand All @@ -65,9 +84,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 +99,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 @@ -122,13 +141,15 @@ jobs:
cpack -G TGZ
- name: Installer TGZ push
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: oracle-targz
path: _build/*.tar.gz

- name: Installer RPM push
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: oracle-rpm
path: _build/*.rpm

- name: Publish assets
Expand All @@ -138,3 +159,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@v4
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-oracle8-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
Loading

0 comments on commit 53f4417

Please sign in to comment.