Skip to content

Commit eb2cdb5

Browse files
chore: add per-platform build caching to CI (#2)
* Initial plan * Add caching to CI builds using hashFiles of platform directories Co-authored-by: jake-arkinstall <65358059+jake-arkinstall@users.noreply.github.com> Agent-Logs-Url: https://github.com/Quantinuum/hugrverse-env/sessions/8fb279c4-4c65-4cd0-b13c-01e37a8fda90 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jake-arkinstall <65358059+jake-arkinstall@users.noreply.github.com>
1 parent 79db0f6 commit eb2cdb5

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929

30+
- name: Restore cached build
31+
id: cache
32+
uses: actions/cache@v4
33+
with:
34+
path: hugrverse_env_manylinux_2_28_x86_64.tar.gz
35+
key: manylinux_2_28_x86_64-${{ hashFiles('builds/manylinux_2_28_x86_64/**') }}
36+
3037
- name: Build inside manylinux_2_28_x86_64 container
38+
if: steps.cache.outputs.cache-hit != 'true'
3139
run: |
3240
docker run --rm \
3341
-v "${{ github.workspace }}:/host" \
@@ -60,7 +68,15 @@ jobs:
6068
steps:
6169
- uses: actions/checkout@v4
6270

71+
- name: Restore cached build
72+
id: cache
73+
uses: actions/cache@v4
74+
with:
75+
path: hugrverse_env_manylinux_2_28_aarch64.tar.gz
76+
key: manylinux_2_28_aarch64-${{ hashFiles('builds/manylinux_2_28_aarch64/**') }}
77+
6378
- name: Build inside manylinux_2_28_aarch64 container
79+
if: steps.cache.outputs.cache-hit != 'true'
6480
run: |
6581
docker run --rm \
6682
-v "${{ github.workspace }}:/host" \
@@ -93,7 +109,15 @@ jobs:
93109
steps:
94110
- uses: actions/checkout@v4
95111

112+
- name: Restore cached build
113+
id: cache
114+
uses: actions/cache@v4
115+
with:
116+
path: hugrverse_env_macosx_15_0_arm64.tar.gz
117+
key: macosx_15_0_arm64-${{ hashFiles('builds/macosx_15_0_arm64/**') }}
118+
96119
- name: Build
120+
if: steps.cache.outputs.cache-hit != 'true'
97121
run: |
98122
bash builds/macosx_15_0_arm64/build.sh \
99123
"${{ github.workspace }}/hugrverse_env_macosx_15_0_arm64.tar.gz"
@@ -123,7 +147,15 @@ jobs:
123147
steps:
124148
- uses: actions/checkout@v4
125149

150+
- name: Restore cached build
151+
id: cache
152+
uses: actions/cache@v4
153+
with:
154+
path: hugrverse_env_macosx_15_0_x86_64.tar.gz
155+
key: macosx_15_0_x86_64-${{ hashFiles('builds/macosx_15_0_x86_64/**') }}
156+
126157
- name: Build
158+
if: steps.cache.outputs.cache-hit != 'true'
127159
run: |
128160
bash builds/macosx_15_0_x86_64/build.sh \
129161
"${{ github.workspace }}/hugrverse_env_macosx_15_0_x86_64.tar.gz"
@@ -153,12 +185,21 @@ jobs:
153185
steps:
154186
- uses: actions/checkout@v4
155187

188+
- name: Restore cached build
189+
id: cache
190+
uses: actions/cache@v4
191+
with:
192+
path: hugrverse_env_win_amd64.zip
193+
key: win_amd64-${{ hashFiles('builds/win_amd64/**') }}
194+
156195
- name: Set up MSVC environment
196+
if: steps.cache.outputs.cache-hit != 'true'
157197
uses: ilammy/msvc-dev-cmd@v1
158198
with:
159199
arch: amd64
160200

161201
- name: Build
202+
if: steps.cache.outputs.cache-hit != 'true'
162203
shell: pwsh
163204
run: |
164205
.\builds\win_amd64\build.ps1 `

0 commit comments

Comments
 (0)