From a5d686572e3289e9d7ce71c063205cc35d4a06c2 Mon Sep 17 00:00:00 2001 From: Florian Jetter Date: Wed, 31 Aug 2022 14:57:22 +0200 Subject: [PATCH] Cache test_report shelves in CI (#6937) --- .github/workflows/test-report.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml index 0186b62f6b7..b316c63d6de 100644 --- a/.github/workflows/test-report.yaml +++ b/.github/workflows/test-report.yaml @@ -14,6 +14,10 @@ jobs: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ github.token }} + PYTHON_VERSION: 3.9 + defaults: + run: + shell: bash -l {0} steps: - uses: actions/checkout@v2 @@ -24,20 +28,27 @@ jobs: miniforge-version: latest condarc-file: continuous_integration/condarc use-mamba: true - python-version: 3.9 + python-version: ${{ env.PYTHON_VERSION }} environment-file: continuous_integration/scripts/test-report-environment.yml activate-environment: dask-distributed - name: Show conda options - shell: bash -l {0} run: conda config --show - name: mamba list - shell: bash -l {0} run: mamba list + - uses: actions/cache@v3 + id: cache + with: + # Suffix is depending on the backend / OS. Let's be agnostic here + # See https://docs.python.org/3/library/shelve.html#shelve.open + path: | + test_report* + !test_report.html + key: ${{ env.PYTHON_VERSION }}-${{ hashFiles('continuous_integration/scripts/test_report*') }} + - name: Generate report - shell: bash -l {0} run: | python continuous_integration/scripts/test_report.py --max-days 90 --max-runs 50 --nfails 1 -o test_report.html python continuous_integration/scripts/test_report.py --max-days 7 --max-runs 50 --nfails 2 -o test_short_report.html --title "Test Short Report"