From ce6def857fadfba04167155f940e24d4301757a9 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 2 Jan 2024 21:03:47 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Set=20Go=20cache=20to=20false,?= =?UTF-8?q?=20introduce=20custom=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The path is set to the newly introduced GOPATH that is set as an environment variable, and the key for the cache is set to `setup.py`, `pyproject.toml` – this can be further refined by setting a different file for the Hugo SHA-256 hash and the version of Hugo being installed. --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e313043..1f31a10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: python-version: ["3.8", "3.12"] - go-version: ["1.20.12", "1.21.5"] + go-version: ["1.20.x", "1.21.x"] runs-on: [ubuntu-latest, macos-latest, windows-latest] steps: @@ -39,6 +39,8 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + cache: false + check-latest: true - name: Install GCC on Linux if: matrix.runs-on == 'ubuntu-latest' @@ -48,6 +50,12 @@ jobs: if: matrix.runs-on == 'windows-latest' run: choco install mingw + - name: Restore Hugo builder cache + uses: actions/cache@v3.3.2 + with: + path: ./hugo_cache/ + key: ${{ runner.os }}-${{ matrix.go-version }}-hugo-build-cache-${{ hashFiles('**/setup.py', '**/pyproject.toml') }} + - name: Install Python dependencies run: python -m pip install build virtualenv nox