Skip to content

Commit 6e77212

Browse files
Change the way in which data are cached
1 parent 17cf363 commit 6e77212

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

.github/workflows/capi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
cargo cinstall --verbose --prefix=/usr/local/ --libdir=/usr/local/lib
2424
ldconfig
2525
26+
- name: Download test data if not cached
27+
uses: ./.github/workflows/download-test-data.yml
28+
2629
- name: Test C++ examples
2730
run: |
2831
cd examples/cpp
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Download/Cache Test Data
2+
on:
3+
workflow_call:
4+
# If needed downstream
5+
outputs:
6+
cache-hit:
7+
description: "Whether cache was hit"
8+
value: ${{ jobs.cache-test.outputs.cache-hit }}
9+
10+
jobs:
11+
cache-test:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
cache-hit: ${{ steps.cache-test-data.outputs.cache-hit }}
15+
steps:
16+
- name: Cache test data
17+
id: cache-test-data
18+
uses: actions/cache@v4
19+
with:
20+
path: test-data
21+
key: test-data-v20
22+
23+
- name: Download test data if cache miss
24+
if: steps.cache-test-data.outputs.cache-hit != 'true'
25+
run: |
26+
cd maintainer
27+
./download-test-data.sh

.github/workflows/python.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,8 @@ jobs:
2424
run: |
2525
rustup component add llvm-tools
2626
27-
- name: Get test data
28-
id: cache-test-data
29-
uses: actions/cache@v4
30-
with:
31-
path: test-data
32-
key: test-data-v20
33-
- name: Download test data
34-
if: steps.cache-test-data.outputs.cache-hit != 'true'
35-
run: |
36-
cd maintainer
37-
./download-test-data.sh
27+
- name: Download test data if not cached
28+
uses: ./.github/workflows/download-test-data.yml
3829

3930
- name: Test
4031
env:

.github/workflows/rust.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,8 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23-
- name: Get test data
24-
id: cache-test-data
25-
uses: actions/cache@v4
26-
with:
27-
path: test-data
28-
key: test-data-v20
29-
- name: Download test data
30-
if: steps.cache-test-data.outputs.cache-hit != 'true'
31-
run: |
32-
cd maintainer
33-
./download-test-data.sh
23+
- name: Download test data if not cached
24+
uses: ./.github/workflows/download-test-data.yml
3425

3526
- name: Set RUSTDOCFLAGS
3627
run: |

examples/cpp/evolve-grid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void print_results(std::vector<double> dxsec_grid, std::vector<double> dxsec_fkt
7878

7979
int main() {
8080
// TODO: How to get a Grid that can be evolved??
81-
std::string filename = "LHCB_WP_7TEV_opt.pineappl.lz4";
81+
std::string filename = "../../test-data/LHCB_WP_7TEV_opt.pineappl.lz4";
8282

8383
// disable LHAPDF banners to guarantee deterministic output
8484
LHAPDF::setVerbosity(0);

0 commit comments

Comments
 (0)