Skip to content

Commit

Permalink
enable ccache for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Csaba Kiraly <[email protected]>
  • Loading branch information
cskiraly committed Jan 21, 2025
1 parent eba62ea commit 51848ec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/actions/nimbus-build-system/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,31 @@ runs:
# Set GCC-14 as the default
sudo update-alternatives --set gcc /usr/bin/gcc-14
- name: Install ccache on Linux/Mac
if: inputs.os == 'linux' || inputs.os == 'macos'
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
key: ${{ matrix.os }}-${{ matrix.builder }}-${{ matrix.cpu }}-${{ matrix.tests }}-${{ matrix.nim_version }}

- name: Install ccache on Windows
if: inputs.os == 'windows'
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.builder }}-${{ matrix.cpu }}-${{ matrix.tests }}-${{ matrix.nim_version }}

- name: Enable ccache on Windows
if: inputs.os == 'windows'
shell: ${{ inputs.shell }} {0}
run: |
CCACHED_DIR=$(dirname $(which ccache))/ccached
mkdir ${CCACHED_DIR}
ln -s $(which ccache) ${CCACHE_DIR}/gcc.exe
ln -s $(which ccache) ${CCACHE_DIR}/g++.exe
ln -s $(which ccache) ${CCACHE_DIR}/cc.exe
ln -s $(which ccache) ${CCACHE_DIR}/c++.exe
echo "export PATH=${CCACHE_DIR}:\$PATH" >> $HOME/.bash_profile # prefix path in MSYS2
- name: Derive environment variables
shell: ${{ inputs.shell }} {0}
run: |
Expand Down Expand Up @@ -194,6 +219,7 @@ runs:
- name: Build Nim and Codex dependencies
shell: ${{ inputs.shell }} {0}
run: |
which gcc
gcc --version
make -j${ncpu} CI_CACHE=NimBinaries ${ARCH_OVERRIDE} QUICK_AND_DIRTY_COMPILER=1 update
echo
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/ci-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ jobs:
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}

- name: ccache
uses: hendrikmuhs/[email protected]
if: matrix.os == 'linux' || matrix.os == 'macos'
with:
create-symlink: true
key: ${{ matrix.os }}-${{ matrix.builder }}-${{ matrix.cpu }}-${{ matrix.tests }}-${{ matrix.nim_version }}

- name: Setup Nimbus Build System
uses: ./.github/actions/nimbus-build-system
with:
Expand Down

0 comments on commit 51848ec

Please sign in to comment.