Skip to content

Commit

Permalink
extra command 3
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 3, 2024
1 parent ca332bd commit 7f22b6b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,21 @@ jobs:
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-centos7-

- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
key: centos7-on-${{ runner.os }}


- name: Build the image and Antares
run: |
docker build \
-t antares:centos7 \
--build-arg="BRANCH=${{ env.REF }}" \
--build-arg="NPROC=$(nproc)" \
--build-arg="VCPKG_CACHE_DIR=./vcpkg_cache" \
--build-arg CCACHE_DIR=/tmp/ccache \
--build-arg CCACHE_KEY=centos7-on-${{ runner.os }} \
-f ${{ env.DOCKERFILE }} .
Expand Down Expand Up @@ -130,3 +138,8 @@ jobs:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}


- name: Save ccache
uses: hendrikmuhs/[email protected]
with:
key: centos7-on-${{ runner.os }}
13 changes: 13 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ RUN ORTOOLS_TAG=$(cat /workspace/Antares_Simulator/ortools_tag) && \
rm ortools.zip

WORKDIR /workspace/Antares_Simulator
# Accept build arguments for ccache
ARG CCACHE_DIR
ARG CCACHE_KEY

# Copy ccache directory into the container
COPY ${CCACHE_DIR:-/dev/null} /home/workspace/.ccache

RUN ls -la /home/workspace/.ccache
# Configure ccache environment variables
ENV CCACHE_DIR=/home/workspace/.ccache
ENV CCACHE_BASEDIR=/home/workspace
ENV CCACHE_COMPRESS=1
ENV PATH="/usr/lib/ccache:$PATH"

RUN source /opt/rh/devtoolset-11/enable && \
source /opt/rh/rh-git227/enable && \
Expand Down

0 comments on commit 7f22b6b

Please sign in to comment.