37
37
- name : " Check C/C++ formatting changes"
38
38
run : git diff --exit-code
39
39
40
+ conan-cache :
41
+ if : github.event.pull_request.draft == false
42
+ runs-on : ubuntu-latest
43
+ env :
44
+ HOST_TYPE : ci
45
+ REDIS_QUEUE_HOST : redis
46
+ REDIS_STATE_HOST : redis
47
+ container :
48
+ image : faasm/faabric:0.2.2
49
+ defaults :
50
+ run :
51
+ working-directory : /code/faabric
52
+ services :
53
+ redis :
54
+ image : redis
55
+ steps :
56
+ # --- Code update ---
57
+ - name : " Fetch ref"
58
+ run : git fetch origin ${GITHUB_REF}:ci-branch
59
+ - name : " Check out branch"
60
+ run : git checkout --force ci-branch
61
+ # --- Set-up ---
62
+ - name : " Ping redis"
63
+ run : redis-cli -h redis ping
64
+ # --- Cache based on Conan version and ExternalProjects cmake source
65
+ - name : Get Conan version
66
+ id : get-conan-version
67
+ run : |
68
+ echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
69
+ shell : bash
70
+ - name : Hash ExternalProjects
71
+ id : hash-external
72
+ run : |
73
+ echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
74
+ shell : bash
75
+ - uses : actions/cache@v2
76
+ with :
77
+ path : ' ~/.conan'
78
+ key : ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
79
+ restore-keys : |
80
+ ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-
81
+ ${{ runner.os }}-
82
+ # --- Build dependencies
83
+ - name : " Build dependencies to be shared by all sanitiser runs"
84
+ run : inv dev.cmake -b Debug
85
+
40
86
tests :
41
87
if : github.event.pull_request.draft == false
88
+ needs : [conan-cache]
42
89
runs-on : ubuntu-latest
43
90
env :
44
91
HOST_TYPE : ci
@@ -61,6 +108,24 @@ jobs:
61
108
# --- Set-up ---
62
109
- name : " Ping redis"
63
110
run : redis-cli -h redis ping
111
+ # --- Cache based on Conan version and ExternalProjects cmake source
112
+ - name : Get Conan version
113
+ id : get-conan-version
114
+ run : |
115
+ echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
116
+ shell : bash
117
+ - name : Hash ExternalProjects
118
+ id : hash-external
119
+ run : |
120
+ echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
121
+ shell : bash
122
+ - uses : actions/cache@v2
123
+ with :
124
+ path : ' ~/.conan'
125
+ key : ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
126
+ restore-keys : |
127
+ ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-
128
+ ${{ runner.os }}-
64
129
# --- Tests build - need a debug build for actually running tests ---
65
130
- name : " Run cmake for tests"
66
131
run : inv dev.cmake --build=Debug
@@ -78,6 +143,16 @@ jobs:
78
143
# --- Code update ---
79
144
- name : " Check out code"
80
145
uses : actions/checkout@v2
146
+ # # --- Cache based on Conan version and ExternalProjects cmake source
147
+ # - name: "Get Conan version"
148
+ # id: get-conan-version
149
+ # run: |
150
+ # echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
151
+ # shell: bash
152
+ # - uses: actions/cache@v2
153
+ # with:
154
+ # path: '~/.conan'
155
+ # key: ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ hashFiles('cmake/ExternalProjects.cmake') }}
81
156
# --- Build and test ---
82
157
- name : " Build distributed tests"
83
158
run : ./dist-test/build.sh
@@ -105,6 +180,24 @@ jobs:
105
180
run : git fetch origin ${GITHUB_REF}:ci-branch
106
181
- name : " Check out branch"
107
182
run : git checkout --force ci-branch
183
+ # --- Cache based on Conan version and ExternalProjects cmake source
184
+ - name : Get Conan version
185
+ id : get-conan-version
186
+ run : |
187
+ echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
188
+ shell : bash
189
+ - name : Hash ExternalProjects
190
+ id : hash-external
191
+ run : |
192
+ echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
193
+ shell : bash
194
+ - uses : actions/cache@v2
195
+ with :
196
+ path : ' ~/.conan'
197
+ key : ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
198
+ restore-keys : |
199
+ ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-
200
+ ${{ runner.os }}-
108
201
# --- Examples ---
109
202
- name : " Run cmake shared"
110
203
run : inv dev.cmake --shared --build=Release
0 commit comments