From ba5b3dff5b624e8d0d341d18894a789c2092aa4c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 6 Nov 2023 13:54:47 +0800 Subject: [PATCH] add cache ci --- .gitea/workflows/test-tidb.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/test-tidb.yml b/.gitea/workflows/test-tidb.yml index 1495e7a6..67bb5cd8 100644 --- a/.gitea/workflows/test-tidb.yml +++ b/.gitea/workflows/test-tidb.yml @@ -16,28 +16,24 @@ jobs: name: test tidb runs-on: ubuntu-latest steps: - # - name: cache go path - # id: cache-go-path - # uses: https://github.com/actions/cache@v3 - # with: - # path: /go_path - # key: go_path-${{ github.repository }}-${{ github.ref_name }} - # restore-keys: | - # go_path-${{ github.repository }}- - # go_path- - # - name: cache go cache - # id: cache-go-cache - # uses: https://github.com/actions/cache@v3 - # with: - # path: /go_cache - # key: go_cache-${{ github.repository }}-${{ github.ref_name }} - # restore-keys: | - # go_cache-${{ github.repository }}- - # go_cache- - uses: actions/setup-go@v3 with: go-version: 1.20 - uses: actions/checkout@v3 + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + id: hash-go + with: + patterns: | + go.mod + go.sum + - name: cache go + id: cache-go + uses: https://github.com/actions/cache@v3 + with: + path: | + /go_path + /go_cache + key: go_path-${{ steps.hash-go.outputs.hash }} - name: test tidb env: TEST_TIDB_HOST: "tidb:4000"