From 3e5bc9497f9f6952f8bfd2c63e3e80a5aacaa0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Birger=20J=2E=20Nord=C3=B8lum?= Date: Sun, 18 Jul 2021 15:04:39 +0200 Subject: [PATCH] ci(lfs): attempt at cache lfs to reduce bandwidth See issue #108 and https://github.com/actions/checkout/issues/165#issuecomment-657673315 --- .github/workflows/tests.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7901a60a..70e0def9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,8 +23,21 @@ jobs: COVERAGE_FILE: ${{ github.workspace }}/.coverage.${{ matrix.python-version }}-${{ matrix.tests }} steps: - uses: actions/checkout@v2 + - name: Create LFS file list + run: | + git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + - name: Restore LFS cache + uses: actions/cache@v2 + id: lfs-cache with: - lfs: true + path: .git/lfs + # The cache of lfs should be the same on all jobs. Not sure + # what happens when an updated has occured and every job tries + # to upload a new versions. + # key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: