From db0071dbd18ccf48f5b0c8ce02f0311620c6d597 Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Wed, 28 Aug 2024 16:45:34 +0200 Subject: [PATCH] chore: try to use artifacts instead of a cache The reason is that caches cannot be used across branches. I hope artifacts can. --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba9a559bf..4ee635dd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,13 +74,20 @@ jobs: - name: Generate proof parameters run: cargo run --release --no-default-features --bin paramcache -- --sector-sizes=${{ matrix.size }} - - name: Cache proof parameters - id: cache-parameters - uses: actions/cache/save@v4 + #- name: Cache proof parameters + # id: cache-parameters + # uses: actions/cache/save@v4 + # with: + # path: /var/tmp/filecoin-proof-parameters/ + # key: proof-params-v28-n-${{ matrix.size }}-${{ hashFiles('filecoin-proofs/parameters.json') }} + + - name: Upload proof parameters as artifact + uses: actions/upload-artifact@v4 with: + name: proof-params-v28-n-${{ matrix.size }}-${{ hashFiles('filecoin-proofs/parameters.json') }} path: /var/tmp/filecoin-proof-parameters/ - key: proof-params-v28-n-${{ matrix.size }}-${{ hashFiles('filecoin-proofs/parameters.json') }} - + compression-level: 0 + if-no-files-found: error test_release: needs: [set-msrv, proof-params] @@ -106,29 +113,54 @@ jobs: # #run: cargo build --release --no-default-features --bin paramcache --sector-sizes='2048,4096,16384,32768' # run: cargo run --release --no-default-features --bin paramcache -- --sector-sizes='2048' - - name: Restore proof parameters cache 2KiB - id: cache-parameters-2048 - uses: actions/cache/restore@v4 - with: - path: /var/tmp/filecoin-proof-parameters/ - #key: proof-params-v28-n-${{ runner.os }}-${{ hashFiles('filecoin-proofs/parameters.json') }} - key: proof-params-v28-n-2048-${{ hashFiles('filecoin-proofs/parameters.json') }} + #- name: Restore proof parameters cache 2KiB + # id: cache-parameters-2048 + # uses: actions/cache/restore@v4 + # with: + # path: /var/tmp/filecoin-proof-parameters/ + # #key: proof-params-v28-n-${{ runner.os }}-${{ hashFiles('filecoin-proofs/parameters.json') }} + # key: proof-params-v28-n-2048-${{ hashFiles('filecoin-proofs/parameters.json') }} + + + + #- name: Get proof parameters 2KiB + # uses: actions/cache/restore@v4 + # with: + # path: /var/tmp/filecoin-proof-parameters/ + # #key: proof-params-v28-n-${{ runner.os }}-${{ hashFiles('filecoin-proofs/parameters.json') }} + # key: proof-params-v28-n-2048-${{ hashFiles('filecoin-proofs/parameters.json') }} + # + # + #- name: List parameter files + # run: ls -al /var/tmp/filecoin-proof-parameters/ + # + #- name: Restore proof parameters cache 4KiB + # id: cache-parameters-4096 + # uses: actions/cache/restore@v4 + # with: + # path: /var/tmp/filecoin-proof-parameters/ + # key: proof-params-v28-n-4096-${{ hashFiles('filecoin-proofs/parameters.json') }} + # + #- name: List parameter files + # run: ls -al /var/tmp/filecoin-proof-parameters/ + # - - name: List parameter files - run: ls -al /var/tmp/filecoin-proof-parameters/ - - name: Restore proof parameters cache 4KiB - id: cache-parameters-4096 - uses: actions/cache/restore@v4 + - name: Get proof parameters + - uses: actions/download-artifact@v4 with: + #name: my-artifact path: /var/tmp/filecoin-proof-parameters/ - key: proof-params-v28-n-4096-${{ hashFiles('filecoin-proofs/parameters.json') }} + merge-multiple: true + github-token: ${{ github.token }} + repository: ${{ github.action_repository }} + - name: Display structure of downloaded files + run: ls -lR /var/tmp/filecoin-proof-parameters/ + - - name: List parameter files - run: ls -al /var/tmp/filecoin-proof-parameters/ - name: Test in release profile - if: steps.cache-parameters-2048.outputs.cache-hit != 'true' && steps.cache-parameters-4096.outputs.cache-hit != 'true' + #if: steps.cache-parameters-2048.outputs.cache-hit == 'true' && steps.cache-parameters-4096.outputs.cache-hit == 'true' run: cargo test --verbose --release --workspace --all-targets ## Some `storage-proofs-update` tests need to run sequentially due ## to their high memory usage.