Skip to content

Commit 5c64523

Browse files
committed
tests: cache sample files
1 parent 950cdee commit 5c64523

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/tox_matrix.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,23 @@ jobs:
4444
steps:
4545

4646
- uses: actions/checkout@v3
47+
- name: Cache sample files
48+
id: cache_samples
49+
uses: actions/cache@v4
50+
with:
51+
path: "{{ github.workspace }}"
52+
key: ${{ hashFiles('sample_images.tar.gz') }}
53+
- name: download sample files
54+
if: steps.cache_samples.outputs.cache-hit != 'true'
55+
run: curl -L https://nexus.library.illinois.edu/repository/sample-data/images/sample_images.tar.gz -o "{{ github.workspace }}/sample_images.tar.gz"
4756
- uses: actions/setup-python@v5
4857
with:
4958
python-version: ${{ matrix.python-version }}
5059
cache: 'pip' # caching pip dependencies
5160
- name: "install Python dependencies"
5261
run: |
5362
pip install uv
54-
- uses: actions/cache@v3
63+
- uses: actions/cache@v4
5564
id: cache
5665
with:
5766
path: "${{ matrix.conan_user_home }}/.conan2"
@@ -86,4 +95,4 @@ jobs:
8695
env:
8796
CONAN_COMPILER_LIBCXX: ${{ matrix.compiler_libcxx }}
8897
CONAN_USER_HOME: ${{ matrix.conan_user_home }}
89-
98+
SAMPLE_IMAGES_ARCHIVE: "{{ github.workspace }}/sample_images.tar.gz"

scripts/resources/windows/tox/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ FROM base_builder AS sample_files_downloader
6868
ARG SAMPLE_IMAGES_URL
6969
ENV EXPECTED_SHA256="0461f57db3806ca47d9063151eec4bc0720c66a83153dda04e230f838b64f063"
7070
ENV downloadPath="C:/sampledata/"
71-
RUN if (-not (Test-Path -Path $downloadPath -PathType Container)) {`
72-
New-Item -Path $downloadPath -ItemType Directory -Force`
71+
RUN if (-not (Test-Path -Path ${env:downloadPath} -PathType Container)) {`
72+
New-Item -Path ${env:downloadPath} -ItemType Directory -Force`
7373
}; `
7474
Invoke-WebRequest -Uri ${env:SAMPLE_IMAGES_URL} -OutFile "${env:downloadPath}\sample_images.tar.gz"
7575

0 commit comments

Comments
 (0)