From c3c82cebd59c55e4580d999ba5baade9e1368f13 Mon Sep 17 00:00:00 2001 From: HaiLaz <739476267@qq.com> Date: Mon, 18 Jul 2022 16:02:21 +0800 Subject: [PATCH] Feature/ci cache (#2010) --- .github/workflows/gf.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gf.yml b/.github/workflows/gf.yml index 12df603cf..101e7c68e 100644 --- a/.github/workflows/gf.yml +++ b/.github/workflows/gf.yml @@ -113,15 +113,13 @@ jobs: - 1521:1521 - strategy: matrix: - go: [ "1.15", "1.16", "1.17" ] + go-version: [ "1.15", "1.16", "1.17" ] goarch: [ "386", "amd64" ] - steps: - - name: Set Up Timezone + - name: Setup Timezone uses: szenius/set-timezone@v1.0 with: timezoneLinux: "Asia/Shanghai" @@ -129,10 +127,27 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set Up Go + - name: Setup Golang ${{ matrix.go-version }} uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go }} + go-version: ${{ matrix.go-version }} + + - name: Setup Golang caches + uses: actions/cache@v3 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/go-build + ~/Library/Caches/go-build + ~\AppData\Local\go-build + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ matrix.go-version }}- - name: Start containers run: docker-compose -f ".github/workflows/docker/docker-compose.yml" up -d --build @@ -172,5 +187,5 @@ jobs: - name: Report Coverage uses: codecov/codecov-action@v2 with: - flags: go-${{ matrix.go }}-${{ matrix.goarch }} + flags: go-${{ matrix.go-version }}-${{ matrix.goarch }}