use cache #3513
Workflow file for this run
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
name: Centos7 CI (push and/or release) | |
on: | |
release: | |
types: [created] | |
push: | |
branches: | |
- develop | |
- feature/* | |
- features/* | |
- fix/* | |
- issue-* | |
- release/* | |
- doc/* | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'created' }} | |
IS_PUSH: ${{ github.event_name == 'push' }} | |
jobs: | |
build: | |
name: Build | |
env: | |
ORTOOLSDIR: ${{ github.workspace }}/or-tools | |
runs-on: ubuntu-latest | |
container: 'antaresrte/rte-antares:centos7-simulator-no-deps' | |
steps: | |
- 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/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: 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 \ | |
-DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \ | |
- name: Build | |
run: | | |
source /opt/rh/devtoolset-9/enable | |
source /opt/rh/rh-git227/enable | |
cmake3 --build _build --config Release -j2 | |
ccache -s | |
- name: Installer .rpm creation | |
run: | | |
cd _build | |
cpack3 -G RPM | |
- name: Solver archive creation | |
run: | | |
cd _build | |
cmake3 --install . --prefix install | |
pushd . | |
cd install/bin | |
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 | |
- 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 | |
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 }} | |
with: | |
asset_paths: '["*/*.tar.gz", "*/*.rpm"]' |