From 4556db7a4198a6da57d6103942a4c2df1ebec0ea Mon Sep 17 00:00:00 2001 From: Thom Bruce Date: Tue, 28 Nov 2023 15:02:02 +0000 Subject: [PATCH] check and load LFS data from cache before pull on CI jobs --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++--- .github/workflows/release.yml | 45 ++++++++++++++++++++++++++++++++--- 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65d3261..6ca0a27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,21 @@ jobs: steps: - uses: actions/checkout@v3 + # with: + # lfs: 'true' + + # https://github.com/actions/checkout/issues/165#issuecomment-657673315 + - 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 + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust }} @@ -40,8 +53,21 @@ jobs: steps: - uses: actions/checkout@v3 + # with: + # lfs: 'true' + + # https://github.com/actions/checkout/issues/165#issuecomment-657673315 + - 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 + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust }} @@ -58,8 +84,21 @@ jobs: steps: - uses: actions/checkout@v3 + # with: + # lfs: 'true' + + # https://github.com/actions/checkout/issues/165#issuecomment-657673315 + - 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 + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ffbb20..8eb7247 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,21 @@ jobs: - uses: olegtarasov/get-tag@v2.1.2 id: get_version - uses: actions/checkout@v3 + # with: + # lfs: 'true' + + # https://github.com/actions/checkout/issues/165#issuecomment-657673315 + - 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 + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust }} @@ -68,8 +81,21 @@ jobs: - uses: olegtarasov/get-tag@v2.1.2 id: get_version - uses: actions/checkout@v3 + # with: + # lfs: 'true' + + # https://github.com/actions/checkout/issues/165#issuecomment-657673315 + - 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 + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust }} @@ -113,8 +139,21 @@ jobs: - uses: olegtarasov/get-tag@v2.1.2 id: get_version - uses: actions/checkout@v3 + # with: + # lfs: 'true' + + # https://github.com/actions/checkout/issues/165#issuecomment-657673315 + - 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 + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 + - name: Git LFS Pull + run: git lfs pull + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust }}