Skip to content

Commit 75451ac

Browse files
committed
CI: Cache for GitHub Actions
Use caches for `ccache` on GitHub actions.
1 parent 0c88663 commit 75451ac

File tree

12 files changed

+131
-1
lines changed

12 files changed

+131
-1
lines changed

.github/workflows/cuda.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v2
2727
- name: install dependencies
28+
run: |
29+
.github/workflows/dependencies/nvcc11.sh
30+
- name: CCache Cache
31+
uses: actions/cache@v2
32+
# - once stored under a key, they become immutable (even if local cache path content changes)
33+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
34+
with:
35+
path: ~/.ccache
36+
key: ccache-cuda-nvcc-${{ hashFiles('.github/workflows/cuda.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
37+
restore-keys: |
38+
ccache-cuda-nvcc-${{ hashFiles('.github/workflows/cuda.yml') }}-
39+
ccache-cuda-nvcc-
40+
- name: install openPMD-api
2841
run: |
2942
.github/workflows/dependencies/nvcc11.sh
3043
export CEI_SUDO="sudo"
@@ -96,6 +109,16 @@ jobs:
96109
- uses: actions/checkout@v2
97110
- name: Dependencies
98111
run: .github/workflows/dependencies/nvhpc.sh
112+
- name: CCache Cache
113+
uses: actions/cache@v2
114+
# - once stored under a key, they become immutable (even if local cache path content changes)
115+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
116+
with:
117+
path: ~/.ccache
118+
key: ccache-cuda-nvhpc-${{ hashFiles('.github/workflows/cuda.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
119+
restore-keys: |
120+
ccache-cuda-nvhpc-${{ hashFiles('.github/workflows/cuda.yml') }}-
121+
ccache-cuda-nvhpc-
99122
- name: Build & Install
100123
run: |
101124
source /etc/profile.d/modules.sh

.github/workflows/dependencies/dpcpp.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ df -h
2121
# https://github.com/ECP-WarpX/WarpX/pull/1566#issuecomment-790934878
2222
sudo apt-get install -y --no-install-recommends \
2323
build-essential \
24+
ccache \
2425
cmake \
2526
intel-oneapi-dpcpp-cpp-compiler intel-oneapi-mkl-devel \
2627
g++ gfortran \

.github/workflows/dependencies/gcc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ sudo apt-get -qqq update
1111
sudo apt-get install -y \
1212
build-essential \
1313
ca-certificates \
14+
ccache \
1415
cmake \
1516
gnupg \
1617
ninja-build \

.github/workflows/dependencies/hip.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sudo apt-get update
2525
# other: rocm-dev rocm-utils
2626
sudo apt-get install -y --no-install-recommends \
2727
build-essential \
28+
ccache \
2829
gfortran \
2930
libnuma-dev \
3031
libopenmpi-dev \

.github/workflows/dependencies/icc.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ export DEBIAN_FRONTEND=noninteractive
1111
sudo apt-get -qqq update
1212
sudo apt-get install -y \
1313
build-essential \
14-
cmake \
1514
ca-certificates \
15+
ccache \
16+
cmake \
1617
gnupg \
1718
pkg-config \
1819
wget

.github/workflows/dependencies/nvcc11.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ sudo apt-get -qqq update
1111
sudo apt-get install -y \
1212
build-essential \
1313
ca-certificates \
14+
ccache \
1415
cmake \
1516
gnupg \
1617
libopenmpi-dev \

.github/workflows/dependencies/nvhpc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sudo apt-get -qqq update
1010
sudo apt-get install -y \
1111
build-essential \
1212
ca-certificates \
13+
ccache \
1314
cmake \
1415
environment-modules \
1516
gnupg \

.github/workflows/hip.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ jobs:
1919
- name: install dependencies
2020
shell: bash
2121
run: .github/workflows/dependencies/hip.sh
22+
- name: CCache Cache
23+
uses: actions/cache@v2
24+
# - once stored under a key, they become immutable (even if local cache path content changes)
25+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
26+
with:
27+
path: ~/.ccache
28+
key: ccache-hip-3dsp-${{ hashFiles('.github/workflows/hip.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
29+
restore-keys: |
30+
ccache-hip-3dsp-${{ hashFiles('.github/workflows/hip.yml') }}-
31+
ccache-hip-3dsp-
2232
- name: build WarpX
2333
shell: bash
2434
run: |
@@ -62,6 +72,16 @@ jobs:
6272
- name: install dependencies
6373
shell: bash
6474
run: .github/workflows/dependencies/hip.sh
75+
- name: CCache Cache
76+
uses: actions/cache@v2
77+
# - once stored under a key, they become immutable (even if local cache path content changes)
78+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
79+
with:
80+
path: ~/.ccache
81+
key: ccache-hip-2ddp-${{ hashFiles('.github/workflows/hip.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
82+
restore-keys: |
83+
ccache-hip-2ddp-${{ hashFiles('.github/workflows/hip.yml') }}-
84+
ccache-hip-2ddp-
6585
- name: build WarpX
6686
shell: bash
6787
run: |

.github/workflows/intel.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ jobs:
2121
- name: install dependencies
2222
run: |
2323
.github/workflows/dependencies/icc.sh
24+
- name: CCache Cache
25+
uses: actions/cache@v2
26+
# - once stored under a key, they become immutable (even if local cache path content changes)
27+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
28+
with:
29+
path: ~/.ccache
30+
key: ccache-intel-icc-${{ hashFiles('.github/workflows/intel.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
31+
restore-keys: |
32+
ccache-intel-icc-${{ hashFiles('.github/workflows/intel.yml') }}-
33+
ccache-intel-icc-
2434
- name: build WarpX
2535
run: |
2636
set +eu
@@ -64,6 +74,16 @@ jobs:
6474
shell: bash
6575
run: |
6676
.github/workflows/dependencies/dpcpp.sh
77+
- name: CCache Cache
78+
uses: actions/cache@v2
79+
# - once stored under a key, they become immutable (even if local cache path content changes)
80+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
81+
with:
82+
path: ~/.ccache
83+
key: ccache-intel-icpx-${{ hashFiles('.github/workflows/intel.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
84+
restore-keys: |
85+
ccache-intel-icpx-${{ hashFiles('.github/workflows/intel.yml') }}-
86+
ccache-intel-icpx-
6787
- name: build WarpX
6888
shell: bash
6989
run: |
@@ -110,6 +130,16 @@ jobs:
110130
shell: bash
111131
run: |
112132
.github/workflows/dependencies/dpcpp.sh
133+
- name: CCache Cache
134+
uses: actions/cache@v2
135+
# - once stored under a key, they become immutable (even if local cache path content changes)
136+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
137+
with:
138+
path: ~/.ccache
139+
key: ccache-intel-dpcc-${{ hashFiles('.github/workflows/intel.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
140+
restore-keys: |
141+
ccache-intel-dpcc-${{ hashFiles('.github/workflows/intel.yml') }}-
142+
ccache-intel-dpcc-
113143
- name: build WarpX
114144
shell: bash
115145
run: |

.github/workflows/macos.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
set +e
2727
rm -rf /usr/local/bin/2to3
2828
brew update
29+
brew install ccache
2930
brew install fftw
3031
brew install libomp
3132
brew install ninja
@@ -34,6 +35,16 @@ jobs:
3435
set -e
3536
brew tap openpmd/openpmd
3637
brew install openpmd-api
38+
- name: CCache Cache
39+
uses: actions/cache@v2
40+
# - once stored under a key, they become immutable (even if local cache path content changes)
41+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
42+
with:
43+
path: ~/.ccache
44+
key: ccache-macos-appleclang-${{ hashFiles('.github/workflows/macos.yml') }}-${{ hashFiles('cmake/dependencies/AMReX.cmake') }}
45+
restore-keys: |
46+
ccache-macos-appleclang-${{ hashFiles('.github/workflows/macos.yml') }}-
47+
ccache-macos-appleclang-
3748
- name: build WarpX
3849
run: |
3950
cmake -S . -B build_dp \

0 commit comments

Comments
 (0)