Feature/ci cache (#2010)

This commit is contained in:
HaiLaz
2022-07-18 16:02:21 +08:00
committed by GitHub
parent 5d51e9fa2c
commit c3c82cebd5

View File

@ -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 }}