Skip to content

Commit a56149e

Browse files
authored
Cache CMake dependencies in CI (simdjson#1282)
Co-authored-by: friendlyanon <friendlyanon@users.noreply.github.com>
1 parent c805fc2 commit a56149e

14 files changed

+61
-4
lines changed

.appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ configuration: Release
44
image: Visual Studio 2019
55
platform: x64
66

7+
cache:
8+
- C:\dependencies -> dependencies\CMakeLists.txt
9+
710
environment:
11+
# Forward slash is used because this is used in CMake as is
12+
simdjson_DEPENDENCY_CACHE_DIR: C:/dependencies
13+
814
matrix:
915
- job_name: VS2019
1016
CMAKE_ARGS: -A %Platform%

.cirrus.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ task:
66

77
env:
88
ASSUME_ALWAYS_YES: YES
9+
simdjson_DEPENDENCY_CACHE_DIR: $HOME/.dep_cache
10+
dep_cache:
11+
folder: $HOME/.dep_cache
12+
reupload_on_changes: false
13+
fingerprint_script: cmake -E sha512sum dependencies/CMakeLists.txt
914
setup_script:
1015
- pkg update -f
1116
- pkg install bash

.github/workflows/alpine.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10+
- uses: actions/cache@v2
11+
with:
12+
path: dependencies/.cache
13+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1014
- name: start docker
1115
run: |
1216
docker run -w /src -dit --name alpine -v $PWD:/src alpine:latest
@@ -24,4 +28,4 @@ jobs:
2428
./alpine.sh cmake --build build_for_alpine
2529
- name: test
2630
run: |
27-
./alpine.sh bash -c "cd build_for_alpine && ctest"
31+
./alpine.sh bash -c "cd build_for_alpine && ctest"

.github/workflows/fuzzers.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
3535
- uses: actions/checkout@v1
3636

37+
- uses: actions/cache@v2
38+
with:
39+
path: dependencies/.cache
40+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
41+
3742
- name: Create and prepare the initial seed corpus
3843
run: |
3944
fuzz/build_corpus.sh
@@ -152,4 +157,3 @@ jobs:
152157
leak-*
153158
timeout-*
154159
if-no-files-found: ignore
155-

.github/workflows/msys2.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ jobs:
3030

3131
steps:
3232
- uses: actions/checkout@v2
33+
- uses: actions/cache@v2
34+
with:
35+
path: dependencies/.cache
36+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
3337
- uses: msys2/setup-msys2@v2
3438
with:
3539
update: true

.github/workflows/ubuntu18-checkperf.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ jobs:
77
runs-on: ubuntu-18.04
88
steps:
99
- uses: actions/checkout@v2
10+
- uses: actions/cache@v2
11+
with:
12+
path: dependencies/.cache
13+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1014
- name: Use cmake
1115
run: |
1216
mkdir build &&
1317
cd build &&
1418
cmake -DSIMDJSON_GOOGLE_BENCHMARKS=ON -DSIMDJSON_BUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX:PATH=destination .. &&
1519
cmake --build . --target checkperf &&
1620
ctest --output-on-failure -R checkperf ubuntu18-checkperf.yml
17-

.github/workflows/ubuntu18.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
runs-on: ubuntu-18.04
88
steps:
99
- uses: actions/checkout@v2
10+
- uses: actions/cache@v2
11+
with:
12+
path: dependencies/.cache
13+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1014
- name: Use cmake
1115
run: |
1216
mkdir build &&

.github/workflows/ubuntu20-checkperf.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
runs-on: ubuntu-20.04
88
steps:
99
- uses: actions/checkout@v2
10+
- uses: actions/cache@v2
11+
with:
12+
path: dependencies/.cache
13+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1014
- name: Use cmake
1115
run: |
1216
mkdir build &&

.github/workflows/ubuntu20.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
runs-on: ubuntu-20.04
88
steps:
99
- uses: actions/checkout@v2
10+
- uses: actions/cache@v2
11+
with:
12+
path: dependencies/.cache
13+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1014
- name: Use cmake
1115
run: |
1216
mkdir build &&

.github/workflows/vs16-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ jobs:
88
runs-on: windows-latest
99
steps:
1010
- uses: actions/checkout@v2
11+
- uses: actions/cache@v2
12+
with:
13+
path: dependencies/.cache
14+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1115
- name: 'Run CMake with VS16'
1216
uses: lukka/run-cmake@v2
1317
with:

.github/workflows/vs16-clang-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ jobs:
88
runs-on: windows-latest
99
steps:
1010
- uses: actions/checkout@v2
11+
- uses: actions/cache@v2
12+
with:
13+
path: dependencies/.cache
14+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1115
- name: 'Run CMake with VS16'
1216
uses: lukka/run-cmake@v2
1317
with:
@@ -22,4 +26,4 @@ jobs:
2226

2327
- name: 'Run CTest'
2428
run: ctest -C Release -E checkperf --output-on-failure
25-
working-directory: "${{ github.workspace }}/../../_temp/windows"
29+
working-directory: "${{ github.workspace }}/../../_temp/windows"

.github/workflows/vs16-ninja-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ jobs:
88
runs-on: windows-latest
99
steps:
1010
- uses: actions/checkout@v2
11+
- uses: actions/cache@v2
12+
with:
13+
path: dependencies/.cache
14+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
1115
- name: 'Run CMake with VS16'
1216
uses: lukka/run-cmake@v2
1317
with:

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ language: cpp
22
dist: bionic
33
arch:
44
- ppc64le
5+
cache:
6+
directories:
7+
- $HOME/.dep_cache
8+
env:
9+
global:
10+
- simdjson_DEPENDENCY_CACHE_DIR=$HOME/.dep_cache
511
matrix:
612
include:
713
- os: linux

dependencies/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.cache/

0 commit comments

Comments
 (0)