From 18bdc4f54efd4cf540959a0d71964047d24b3fd4 Mon Sep 17 00:00:00 2001 From: guochao Date: Wed, 19 Feb 2025 20:46:53 +0800 Subject: [PATCH] configure caches --- .gitea/workflows/container-build.yaml | 6 ++++++ .gitea/workflows/go-test.yaml | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/.gitea/workflows/container-build.yaml b/.gitea/workflows/container-build.yaml index bd2a8c6..8382526 100644 --- a/.gitea/workflows/container-build.yaml +++ b/.gitea/workflows/container-build.yaml @@ -15,6 +15,12 @@ jobs: if: ${{ vars.DEBIAN_MIRROR && vars.DEBIAN_APT_SOURCES }} - name: Setup debian environment run: apt update && apt install -y podman podman-compose nodejs + - name: Setup cache for podman + uses: actions/cache@v4 + with: + path: | + /var/lib/containers + key: podman-storage - name: Check out repository code uses: actions/checkout@v4 - name: Build container diff --git a/.gitea/workflows/go-test.yaml b/.gitea/workflows/go-test.yaml index 8410332..dd32db4 100644 --- a/.gitea/workflows/go-test.yaml +++ b/.gitea/workflows/go-test.yaml @@ -7,6 +7,7 @@ on: - go.mod - go.lock - go.work + - .gitea/workflows/go-test.yaml env: GOPROXY: ${{ vars.GOPROXY }} @@ -19,10 +20,20 @@ jobs: if: ${{ vars.DEBIAN_MIRROR && vars.DEBIAN_APT_SOURCES }} - name: Setup Debian environment run: apt update && apt install -y nodejs + - name: Setup cache for golang toolchain + uses: actions/cache@v4 + with: + path: | + /opt/hostedtoolcache/go + /root/go/pkg/mod + /root/.cache/go-build + key: ${{ runner.os }}-golang - name: Setup Golang uses: actions/setup-go@v5 with: go-version: 1.24.0 + cache-dependency-path: | + go.sum - name: Check out repository code uses: actions/checkout@v4 - name: Run tests