forked from AntaresSimulatorTeam/Antares_Simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AntaresSimulatorTeam:develop' into codespace-didactic-y…
…odel-pjr5j955wjxrhr669
- Loading branch information
Showing
2,189 changed files
with
101,694 additions
and
91,854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,40 @@ on: | |
push: | ||
branches: | ||
- release/* | ||
- feature/* | ||
- features/* | ||
- fix/* | ||
- issue-* | ||
- doc/* | ||
- dependabot/* | ||
workflow_call: | ||
inputs: | ||
run-tests: | ||
required: true | ||
type: string | ||
target_branch: | ||
required: true | ||
type: string | ||
|
||
env: | ||
IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
runs-on: ubuntu-20.04 | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.target_branch}} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
python-version: 3.12 | ||
|
||
- name: Install dependencies | ||
run: | | ||
|
@@ -50,15 +62,17 @@ jobs: | |
echo "PDF_PATH_ASSET= [\"docs/pdf-doc-generation-with-sphinx/$PDF_NAME\"]" >> $GITHUB_ENV | ||
- name: user guide upload | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pdf-reference-guide | ||
path: ${{ env.PDF_PATH }} | ||
|
||
- name: Upload user guide as release asset | ||
|
||
- name: Publish assets | ||
if: ${{ env.IS_RELEASE == 'true' }} | ||
uses: alexellis/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
asset_paths: ${{ env.PDF_PATH_ASSET }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
tag: ${{ github.event.inputs.release_tag }} | ||
run: | | ||
gh release upload "$tag" ${{ env.PDF_PATH }} | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,23 @@ on: | |
push: | ||
branches: | ||
- develop | ||
- dependabot/* | ||
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 == 'release' && github.event.action == 'created' }} | ||
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} | ||
IS_PUSH: ${{ github.event_name == 'push' }} | ||
REF: ${{ inputs.target_branch =='' && github.ref_name || inputs.target_branch}} | ||
|
||
jobs: | ||
|
||
|
@@ -28,23 +38,43 @@ jobs: | |
|
||
- name: Checkout | ||
run: | | ||
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME . | ||
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ env.REF }} . | ||
- name: Init submodule | ||
- name: Install gcc 10 | ||
run: | | ||
git submodule update --init --remote src/antares-deps src/tests/resources/Antares_Simulator_Tests | ||
yum install -y centos-release-scl | ||
yum install -y devtoolset-10-gcc* | ||
- name: Install cmake 3.28 | ||
run: pip3 install cmake==3.28.4 | ||
|
||
- name: Download & extract precompiled deps at root | ||
- 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: | | ||
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 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: Init submodule | ||
run: | | ||
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/v9.5-rte2.0/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV | ||
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 | ||
|
@@ -54,46 +84,55 @@ jobs: | |
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-9/enable | ||
cmake3 -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=OFF \ | ||
-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: | | ||
source /opt/rh/devtoolset-9/enable | ||
source /opt/rh/devtoolset-10/enable | ||
source /opt/rh/rh-git227/enable | ||
cmake3 --build _build --config Release -j2 | ||
cmake --build _build --config Release -j$(nproc) | ||
ccache -s | ||
- name: Installer .rpm creation | ||
run: | | ||
cd _build | ||
cpack3 -G RPM | ||
cpack -G RPM | ||
- name: Solver archive creation | ||
run: | | ||
cd _build | ||
cmake3 --install . --prefix install | ||
cmake --install . --prefix install | ||
pushd . | ||
cd install/bin | ||
tar czf ../../antares-solver_centos7.tar.gz antares-*-solver libsirius_solver.so | ||
tar czf ../../antares-solver_centos7.tar.gz antares-solver libsirius_solver.so | ||
popd | ||
rm -rf install | ||
- name: .tar.gz creation | ||
run: | | ||
cd _build | ||
cpack3 -G TGZ | ||
cpack -G TGZ | ||
- name: Installer TGZ push | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -105,21 +144,18 @@ jobs: | |
with: | ||
path: _build/*.rpm | ||
|
||
publish_assets: | ||
name: Publish assets | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download all artifacts | ||
if: ${{ env.IS_RELEASE == 'true' }} | ||
uses: actions/download-artifact@v3 | ||
|
||
|
||
- name: Publish assets | ||
if: ${{ env.IS_RELEASE == 'true' }} | ||
uses: alexellis/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
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: | ||
asset_paths: '["*/*.tar.gz", "*/*.rpm"]' | ||
path: ${{ env.VCPKG_CACHE_DIR }} | ||
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Check cpp formatting | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- feature/* | ||
- features/* | ||
- fix/* | ||
|
||
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" | ||
echo "$DIFF" | ||
exit 1 | ||
else | ||
echo "Code is well formatted, congrats !" | ||
fi |
Oops, something went wrong.