1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

enable caching in workflows

This commit is contained in:
Matthieu MOREL 2021-12-23 00:46:14 +01:00 committed by GitHub
parent 851bffc0f1
commit f8c685e717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View File

@ -13,6 +13,18 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- id: cache-paths
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
- name: Cache go modules
uses: actions/cache@v2
with:
path: |
${{ steps.cache-paths.outputs.cache }}
${{ steps.cache-paths.outputs.mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Build Test v3
run: |
make build_test
make build_test

View File

@ -14,6 +14,18 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- id: cache-paths
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
- name: Cache go modules
uses: actions/cache@v2
with:
path: |
${{ steps.cache-paths.outputs.cache }}
${{ steps.cache-paths.outputs.mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Test
run: |
go test ./...
go test ./...