Skip to content

Commit e30290a

Browse files
committed
avoid duplicated downloads of Z3 and PCRE archives in CI by caching them
1 parent 85ccfe2 commit e30290a

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

.github/workflows/CI-windows.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ jobs:
4242
if: matrix.qt_ver == ''
4343
uses: microsoft/setup-msbuild@v1.0.2
4444

45-
- name: Download PCRE
45+
- name: Cache PCRE
46+
id: cache-pcre
47+
uses: actions/cache@v2
4648
if: matrix.arch == 'x64' || matrix.qt_ver == ''
49+
with:
50+
path: pcre-${{ env.PCRE_VERSION }}.zip
51+
key: pcre-${{ env.PCRE_VERSION }}
52+
53+
- name: Download PCRE
54+
if: (matrix.arch == 'x64' || matrix.qt_ver == '') && steps.cache-pcre.outputs.cache-hit != 'true'
4755
run: |
4856
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
4957
@@ -64,8 +72,16 @@ jobs:
6472
env:
6573
CL: /MP
6674

67-
- name: Download Z3 library
75+
- name: Cache Z3 Library
76+
id: cache-z3
77+
uses: actions/cache@v2
6878
if: matrix.arch == 'x64' || matrix.qt_ver == ''
79+
with:
80+
path: z3-${{ env.Z3_VERSION }}-${{ matrix.arch }}-win.zip
81+
key: z3-${{ env.Z3_VERSION }}-${{ matrix.arch }}-win
82+
83+
- name: Download Z3 library
84+
if: (matrix.arch == 'x64' || matrix.qt_ver == '') && steps.cache-z3.outputs.cache-hit != 'true'
6985
run: |
7086
curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-%Z3_VERSION%/z3-%Z3_VERSION%-${{ matrix.arch }}-win.zip -o z3-%Z3_VERSION%-${{ matrix.arch }}-win.zip || exit /b !errorlevel!
7187

.github/workflows/release-windows.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@ jobs:
3434
- name: Setup msbuild.exe
3535
uses: microsoft/setup-msbuild@v1.0.2
3636

37+
- name: Cache PCRE
38+
id: cache-pcre
39+
uses: actions/cache@v2
40+
with:
41+
path: pcre-${{ env.PCRE_VERSION }}.zip
42+
key: pcre-${{ env.PCRE_VERSION }}
43+
3744
- name: Download PCRE
45+
if: steps.cache-pcre.outputs.cache-hit != 'true'
3846
run: |
3947
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip
4048
@@ -51,7 +59,15 @@ jobs:
5159
copy pcre.h ..\externals
5260
copy Release\pcre.lib ..\externals\pcre64.lib
5361
62+
- name: Cache Z3 Library
63+
id: cache-z3
64+
uses: actions/cache@v2
65+
with:
66+
path: z3-${{ env.Z3_VERSION }}-x64-win.zip
67+
key: z3-${{ env.Z3_VERSION }}-x64-win
68+
5469
- name: Download Z3 library
70+
if: steps.cache-z3.outputs.cache-hit != 'true'
5571
run: |
5672
curl -fsSL https://github.com/Z3Prover/z3/releases/download/z3-%Z3_VERSION%/z3-%Z3_VERSION%-x64-win.zip -o z3-%Z3_VERSION%-x64-win.zip
5773

0 commit comments

Comments
 (0)