From 83f1a0572d24bdb0bd58c1a1c3d0e481518e40db Mon Sep 17 00:00:00 2001 From: JacksonMaxfield Date: Mon, 20 Sep 2021 15:13:28 -0700 Subject: [PATCH 1/2] Add caching of test resources to GH actions --- .github/workflows/build-main.yml | 8 ++++++-- .github/workflows/test-and-lint.yml | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 1eaea627b..993e9016c 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -42,9 +42,13 @@ jobs: run: | python -m pip install --upgrade pip pip install .[test] + - uses: actions/cache@v2 + id: cache + with: + path: aicsimageio/tests/resources + key: ${{ hashFiles('scripts/TEST_RESOURCES_HASH.txt') }} - name: Download Test Resources - run: | - python scripts/download_test_resources.py --debug + if: steps.cache.outputs.cache-hit != 'true' - name: Run tests with Tox # Run tox using the version of Python in `PATH` run: tox -e py diff --git a/.github/workflows/test-and-lint.yml b/.github/workflows/test-and-lint.yml index aeea6befc..8ab5a5dad 100644 --- a/.github/workflows/test-and-lint.yml +++ b/.github/workflows/test-and-lint.yml @@ -28,9 +28,13 @@ jobs: run: | python -m pip install --upgrade pip pip install .[test] + - uses: actions/cache@v2 + id: cache + with: + path: aicsimageio/tests/resources + key: ${{ hashFiles('scripts/TEST_RESOURCES_HASH.txt') }} - name: Download Test Resources - run: | - python scripts/download_test_resources.py --debug + if: steps.cache.outputs.cache-hit != 'true' - name: Run tests with Tox # Run tox using the version of Python in `PATH`, and don't include remote resources run: tox -e py -- -k "not REMOTE" From 2b73109a0263c97837f3113c0a632d6fb335fd3b Mon Sep 17 00:00:00 2001 From: JacksonMaxfield Date: Mon, 20 Sep 2021 15:15:52 -0700 Subject: [PATCH 2/2] Forgot the run clause --- .github/workflows/build-main.yml | 2 ++ .github/workflows/test-and-lint.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 993e9016c..01bb0ec2a 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -49,6 +49,8 @@ jobs: key: ${{ hashFiles('scripts/TEST_RESOURCES_HASH.txt') }} - name: Download Test Resources if: steps.cache.outputs.cache-hit != 'true' + run: | + python scripts/download_test_resources.py --debug - name: Run tests with Tox # Run tox using the version of Python in `PATH` run: tox -e py diff --git a/.github/workflows/test-and-lint.yml b/.github/workflows/test-and-lint.yml index 8ab5a5dad..dd73b5fa4 100644 --- a/.github/workflows/test-and-lint.yml +++ b/.github/workflows/test-and-lint.yml @@ -35,6 +35,8 @@ jobs: key: ${{ hashFiles('scripts/TEST_RESOURCES_HASH.txt') }} - name: Download Test Resources if: steps.cache.outputs.cache-hit != 'true' + run: | + python scripts/download_test_resources.py --debug - name: Run tests with Tox # Run tox using the version of Python in `PATH`, and don't include remote resources run: tox -e py -- -k "not REMOTE"