Skip to content

Commit

Permalink
Revert "Use [email protected] minizip-ng 4.0.1 (from 3.0…
Browse files Browse the repository at this point in the history
….7)"
  • Loading branch information
a-zakir committed Jun 28, 2024
1 parent 6893138 commit 6258350
Show file tree
Hide file tree
Showing 9 changed files with 599 additions and 820 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/centos7-system-deps-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Centos7 CI (deps. compilation)

on:
push:
branches:
- release/*
- develop

jobs:

build:

runs-on: ubuntu-latest
container: 'centos:7'

steps:

- name: Set up Python
run: |
yum update -y
yum install -y python3 python3-pip
- name: Install libraries
run: |
yum install -y epel-release
yum install -y git redhat-lsb-core gcc gcc-c++ make wget centos-release-scl scl-utils rpm-build
yum install -y devtoolset-9
yum install -y rh-git227-git
yum install -y unzip libuuid-devel wxGTK3-devel boost-test boost-devel
- name: Install cmake
run: |
wget https://github.com/Kitware/CMake/releases/download/v3.25.3/cmake-3.25.3-linux-x86_64.tar.gz
tar xvf cmake-3.25.3-linux-x86_64.tar.gz -C /
echo "/cmake-3.25.3-linux-x86_64/bin" >> $GITHUB_PATH
rm cmake-3.25.3-linux-x86_64.tar.gz
- name: Checkout
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME .
- name: Init submodule
run: |
git submodule update --init --recursive src .
- name: Install dependencies
run: |
pip3 install -r src/tests/examples/requirements.txt
- name: Configure
run: |
source /opt/rh/devtoolset-9/enable
#git 2.x must be enabled for Coin compilation with CMake ExternalProject_Add
source /opt/rh/rh-git227/enable
cmake -B _build -S src -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
- name: Build
run: |
source /opt/rh/devtoolset-9/enable
source /opt/rh/rh-git227/enable
cmake --build _build --config release -j2
- name: Installer .rpm creation
run: |
cd _build
cpack -G RPM
- name: Installer .tar.gz creation
run: |
cd _build
cpack -G TGZ
- name: Installer archive upload
uses: actions/upload-artifact@v3
with:
name: antares-centos7-archive
path: _build/*.tar.gz

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

125 changes: 45 additions & 80 deletions .github/workflows/centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,17 @@ on:
push:
branches:
- develop
- dependabot/*
schedule:
- cron: '21 2 * * *'
workflow_call:
inputs:
run-tests:
required: true
type: string
target_branch:
required: true
type: string
- feature/*
- features/*
- fix/*
- issue-*
- release/*
- doc/*

env:
GITHUB_TOKEN: ${{ github.token }}
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }}
IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'created' }}
IS_PUSH: ${{ github.event_name == 'push' }}
REF: ${{ inputs.target_branch =='' && github.ref_name || inputs.target_branch}}

jobs:

Expand All @@ -38,39 +32,19 @@ jobs:

- name: Checkout
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ env.REF }} .
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME .
- name: Install gcc 10
- name: Init submodule
run: |
yum install -y centos-release-scl
yum install -y devtoolset-10-gcc*
- name: Install cmake 3.28
run: pip3 install cmake==3.28.4
git submodule update --init --recursive src/antares-deps src/tests/resources/Antares_Simulator_Tests
- 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
- name: Download & extract precompiled deps at root
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-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
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: |
Expand All @@ -84,56 +58,44 @@ jobs:
unzip -q ortools.zip
rm ortools.zip
- 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
- name: Configure
run: |
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 \
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 \
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \
- name: Build
run: |
source /opt/rh/devtoolset-10/enable
source /opt/rh/devtoolset-9/enable
source /opt/rh/rh-git227/enable
cmake --build _build --config Release -j$(nproc)
cmake3 --build _build --config Release -j2
ccache -s
- name: Installer .rpm creation
run: |
cd _build
cpack -G RPM
cpack3 -G RPM
- name: Solver archive creation
run: |
cd _build
cmake --install . --prefix install
cmake3 --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
cpack -G TGZ
cpack3 -G TGZ
- name: Installer TGZ push
uses: actions/upload-artifact@v3
Expand All @@ -145,18 +107,21 @@ 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 }}
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
GITHUB_TOKEN: ${{ github.token }}
with:
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
asset_paths: '["*/*.tar.gz", "*/*.rpm"]'
Loading

0 comments on commit 6258350

Please sign in to comment.