Skip to content

Commit 59c3a0c

Browse files
committed
Add ccache support to one of the Windows CIs
1 parent 856e03f commit 59c3a0c

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/windows.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,53 @@ jobs:
5959
if: github.event.pull_request.draft == false
6060
steps:
6161
- uses: actions/checkout@v3
62+
- uses: seanmiddleditch/gha-setup-ninja@master
63+
- name: Set Up Cache
64+
uses: actions/cache@v3
65+
with:
66+
path: ~/.ccache
67+
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
68+
restore-keys: |
69+
ccache-${{ github.workflow }}-${{ github.job }}-git-
6270
- uses: actions/setup-python@v4
6371
with:
6472
python-version: '3.x'
6573
- uses: seanmiddleditch/gha-setup-ninja@master
74+
- name: Install Ccache
75+
run: |
76+
Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-windows-x86_64.zip -OutFile ccache-4.8-windows-x86_64.zip
77+
Expand-Archive ccache-4.8-windows-x86_64.zip
6678
- name: Build
6779
run: |
80+
$ccachepath = Join-Path $pwd "ccache-4.8-windows-x86_64"
81+
$Env:PATH += ";$ccachepath"
82+
$ccachecachedir = Join-Path $HOME ".ccache"
83+
$Env:CCACHE_DIR="$ccachecachedir"
84+
$Env:CCACHE_DIR
85+
$Env:CCACHE_COMPRESS='1'
86+
$Env:CCACHE_COMPRESSLEVEL='10'
87+
$Env:CCACHE_MAXSIZE='300M'
88+
ccache -z
89+
6890
python3 -m pip install -U pip setuptools wheel pytest
6991
python3 -m pip install -U cmake
7092
python3 -m pip install -r requirements.txt
7193
7294
cmake -S . -B build `
95+
-G "Ninja" `
7396
-T "ClangCl" `
7497
-DCMAKE_VERBOSE_MAKEFILE=ON `
7598
-DBUILD_SHARED_LIBS=ON `
7699
-DAMReX_MPI=OFF `
77-
-DAMReX_SPACEDIM="1;2;3"
100+
-DAMReX_SPACEDIM="1;2;3" `
101+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
78102
if(!$?) { Exit $LASTEXITCODE }
79103
80104
cmake --build build --config Debug -j 2
81105
if(!$?) { Exit $LASTEXITCODE }
106+
107+
ccache -s
108+
82109
- name: Unit tests
83110
run: |
84111
ctest --test-dir build -C Debug --output-on-failure

0 commit comments

Comments
 (0)