Skip to content

Commit a376f75

Browse files
committed
chore: try to build caches in parallel
1 parent 9c8059c commit a376f75

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

.github/workflows/ci.yml

+56-8
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,14 @@ jobs:
5555
# - name: Run cargo fmt
5656
# run: cargo fmt --all -- --check
5757

58-
test_release:
58+
proof-params:
5959
needs: set-msrv
6060
runs-on: ubuntu-latest
61-
name: Build and test
61+
name: Generate proof parameters and cache them
62+
strategy:
63+
matrix:
64+
size: [2048, 4096]
65+
6266
steps:
6367
- uses: actions/checkout@v4
6468
- uses: dtolnay/rust-toolchain@master
@@ -67,17 +71,61 @@ jobs:
6771
- name: Install required packages
6872
run: sudo apt install --no-install-recommends --yes ocl-icd-opencl-dev libhwloc-dev
6973

74+
- name: Generate proof parameters
75+
run: cargo run --release --no-default-features --bin paramcache -- --sector-sizes=${{ matrix.size }}
76+
7077
- name: Cache proof parameters
7178
id: cache-parameters
72-
uses: actions/cache@v4
79+
uses: actions/cache/save@v4
80+
with:
81+
path: /var/tmp/filecoin-proof-parameters/
82+
key: proof-params-v28-n-${{ matrix.size }}-${{ hashFiles('filecoin-proofs/parameters.json') }}
83+
84+
85+
test_release:
86+
needs: [set-msrv, proof-params]
87+
runs-on: ubuntu-latest
88+
name: Test in release mode
89+
steps:
90+
- uses: actions/checkout@v4
91+
- uses: dtolnay/rust-toolchain@master
92+
with:
93+
toolchain: ${{needs.set-msrv.outputs.msrv}}
94+
- name: Install required packages
95+
run: sudo apt install --no-install-recommends --yes ocl-icd-opencl-dev libhwloc-dev
96+
97+
#- name: Cache proof parameters
98+
# id: cache-parameters
99+
# uses: actions/cache@v4
100+
# with:
101+
# path: /var/tmp/filecoin-proof-parameters/
102+
# #key: proof-params-v28-n-${{ runner.os }}-${{ hashFiles('filecoin-proofs/parameters.json') }}
103+
# key: proof-params-v28-n-${{ hashFiles('filecoin-proofs/parameters.json') }}
104+
#- name: Generate proof parameters
105+
# if: steps.cache-parameters.outputs.cache-hit != 'true'
106+
# #run: cargo build --release --no-default-features --bin paramcache --sector-sizes='2048,4096,16384,32768'
107+
# run: cargo run --release --no-default-features --bin paramcache -- --sector-sizes='2048'
108+
109+
- name: Restore proof parameters cache 2KiB
110+
id: cache-parameters
111+
uses: actions/cache/restore@v4
73112
with:
74113
path: /var/tmp/filecoin-proof-parameters/
75114
#key: proof-params-v28-n-${{ runner.os }}-${{ hashFiles('filecoin-proofs/parameters.json') }}
76-
key: proof-params-v28-n-${{ hashFiles('filecoin-proofs/parameters.json') }}
77-
- name: Generate proof parameters
78-
if: steps.cache-parameters.outputs.cache-hit != 'true'
79-
#run: cargo build --release --no-default-features --bin paramcache --sector-sizes='2048,4096,16384,32768'
80-
run: cargo run --release --no-default-features --bin paramcache -- --sector-sizes='2048'
115+
key: proof-params-v28-n-2048-${{ hashFiles('filecoin-proofs/parameters.json') }}
116+
117+
- name: List parameter files:
118+
run: ls -al /var/tmp/filecoin-proof-parameters/
119+
120+
- name: Restore proof parameters cache 4KiB
121+
id: cache-parameters
122+
uses: actions/cache/restore@v4
123+
with:
124+
path: /var/tmp/filecoin-proof-parameters/
125+
key: proof-params-v28-n-4096-${{ hashFiles('filecoin-proofs/parameters.json') }}
126+
127+
- name: List parameter files:
128+
run: ls -al /var/tmp/filecoin-proof-parameters/
81129

82130
- name: Test in release profile
83131
run: cargo test --verbose --release --workspace --all-targets

0 commit comments

Comments
 (0)