diff --git a/.github/workflows/unittests-rust.yml b/.github/workflows/unittests-rust.yml index 0f07005dc..cd84830fc 100644 --- a/.github/workflows/unittests-rust.yml +++ b/.github/workflows/unittests-rust.yml @@ -16,8 +16,7 @@ jobs: - name: Download test data if: steps.cache-test-data.outputs.cache-hit != 'true' run: | - cd crates/dekoder/tests/data - ./download.sh + ./test/data/assets.sh - uses: actions/setup-python@v5 - name: Install task runner run: pip install poethepoet diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index a21b8531e..ee8df1d64 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -3,7 +3,22 @@ name: Python unit tests on: push jobs: + data: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get test data + id: cache-test-data + uses: actions/cache@v4 + with: + path: test-data + key: test-data-v1 + - name: Download test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + run: | + ./test/data/assets.sh test: + needs: data strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] diff --git a/crates/dekoder/tests/data/download.sh b/crates/dekoder/tests/data/download.sh deleted file mode 100755 index afcc880ec..000000000 --- a/crates/dekoder/tests/data/download.sh +++ /dev/null @@ -1,3 +0,0 @@ -# upload: scp v0.15.tar nnpdf@data.nnpdf.science:WEB/eko/test-data - -curl -s -C - -O 'https://data.nnpdf.science/eko/test-data/v0.15.tar' diff --git a/download-test-assets.sh b/download-test-assets.sh deleted file mode 100755 index 5b45e10b6..000000000 --- a/download-test-assets.sh +++ /dev/null @@ -1,8 +0,0 @@ -# upload: scp v0.15.tar nnpdf@data.nnpdf.science:WEB/eko/test-data - -curl -s -C - -o './tests/data/v0.15.tar' 'https://data.nnpdf.science/eko/test-data/v0.15.tar' -curl -s -C - -o './tests/data/v0.13.tar' 'https://data.nnpdf.science/eko/test-data/ekov013.tar' -curl -s -C - -o './tests/data/v0.14.tar' 'https://data.nnpdf.science/eko/test-data/ekov014.tar' - - - diff --git a/tests/data/assets.sh b/tests/data/assets.sh new file mode 100755 index 000000000..9d96539ac --- /dev/null +++ b/tests/data/assets.sh @@ -0,0 +1,17 @@ +#!/usr/bin/bash +# upload: scp v0.15.tar nnpdf@data.nnpdf.science:WEB/eko/test-data + +# Server path +URL="https://data.nnpdf.science/eko/test-data/" +# local paths +PYDATADIR="tests/data/" +RUSTDATADIR="crates/dekoder/tests/data/" + +# download from the server +curl -s -C - -o "./${PYDATADIR}v0.13.tar" "${URL}ekov013.tar" +curl -s -C - -o "./${PYDATADIR}v0.14.tar" "${URL}ekov014.tar" +curl -s -C - -o "./${PYDATADIR}v0.15.tar" "${URL}v0.15.tar" +# expose to Rust +if [ ! -f "./${RUSTDATADIR}v0.15.tar" ]; then + ln -s "./../../../../${PYDATADIR}v0.15.tar" "./${RUSTDATADIR}" +fi