Skip to content

Commit

Permalink
Add ccache support to one of the Windows CIs
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Sep 7, 2023
1 parent 856e03f commit 59c3a0c
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,53 @@ jobs:
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Set Up Cache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Install Ccache
run: |
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
Expand-Archive ccache-4.8-windows-x86_64.zip
- name: Build
run: |
$ccachepath = Join-Path $pwd "ccache-4.8-windows-x86_64"
$Env:PATH += ";$ccachepath"
$ccachecachedir = Join-Path $HOME ".ccache"
$Env:CCACHE_DIR="$ccachecachedir"
$Env:CCACHE_DIR
$Env:CCACHE_COMPRESS='1'
$Env:CCACHE_COMPRESSLEVEL='10'
$Env:CCACHE_MAXSIZE='300M'
ccache -z
python3 -m pip install -U pip setuptools wheel pytest
python3 -m pip install -U cmake
python3 -m pip install -r requirements.txt
cmake -S . -B build `
-G "Ninja" `
-T "ClangCl" `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DBUILD_SHARED_LIBS=ON `
-DAMReX_MPI=OFF `
-DAMReX_SPACEDIM="1;2;3"
-DAMReX_SPACEDIM="1;2;3" `
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
if(!$?) { Exit $LASTEXITCODE }
cmake --build build --config Debug -j 2
if(!$?) { Exit $LASTEXITCODE }
ccache -s
- name: Unit tests
run: |
ctest --test-dir build -C Debug --output-on-failure
Expand Down

0 comments on commit 59c3a0c

Please sign in to comment.