Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 2, 2024
1 parent 9ec9c55 commit a6fa16f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
sparse-checkout: |
docker/Dockerfile
docker/AntaresDeps
src/vcpkg.json
ref: ${{ env.REF }}

- name: set env variables -- DockerFiles
Expand Down Expand Up @@ -73,6 +74,22 @@ jobs:
cache: false
tags: latest

- name: create vcpkg cache dir
run: |
echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV
mkdir -p ${{ env.VCPKG_CACHE_DIR }}
- 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: Build the image and Antares
run: |
docker build \
Expand All @@ -87,6 +104,11 @@ jobs:
container_id=$(docker create antares:centos7)
mkdir archive
docker cp $container_id:/workspace/Antares_Simulator/_build/archive/ archive/
ls ${{ env.VCPKG_CACHE_DIR }}
echo "-----------------"
docker cp $container_id:/workspace/vcpkg-cache ${{ env.VCPKG_CACHE_DIR }}
ls ${{ env.VCPKG_CACHE_DIR }}
echo "-----------------"
ls archive
docker rm $container_id
Expand All @@ -99,3 +121,12 @@ jobs:
run: |
gh release upload "$tag" archive/*.tar.gz archive/*.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') }}

7 changes: 7 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ RUN echo "source /opt/rh/devtoolset-11/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]



ENV VCPKG_BINARY_SOURCES="clear;files,/workspace/vcpkg_cache,readwrite"
RUN mkdir -p /workspace/vcpkg_cache
ARG VCPKG_CACHE_DIR
COPY ${VCPKG_CACHE_DIR} /workspace/vcpkg_cache/

ARG BRANCH=develop
RUN cd /workspace && \
git clone https://github.com/AntaresSimulatorTeam/Antares_Simulator.git --branch $BRANCH && \
Expand All @@ -20,6 +26,7 @@ RUN cd /workspace && \




RUN ORTOOLS_TAG=$(cat /workspace/Antares_Simulator/ortools_tag) && \
echo "ORTOOLS_TAG=$ORTOOLS_TAG" && \
URL_ORTOOLS=https://github.com/rte-france/or-tools-rte/releases/download/$ORTOOLS_TAG/ortools_cxx_centos7_static_sirius.zip && \
Expand Down

0 comments on commit a6fa16f

Please sign in to comment.