forked from FerretDB/github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
40 lines (36 loc) · 1.1 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
name: "Setup Go"
description: "Installs Go, downloads project's Go modules, and restores build and golangci-lint caches"
inputs:
cache-key:
description: "First part of key for restoring cache."
required: false
outputs:
cache_week:
description: "Cache week, a part of cache key."
value: ${{ steps.run.outputs.cache_week }}
runs:
using: "composite"
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22.1"
cache: false
- name: Run tool
id: run
run: go mod download; go run .
working-directory: ${{ github.action_path }}
shell: bash
- name: Restore cache
if: inputs.cache-key != ''
uses: actions/cache@v4
with:
path: ${{ steps.run.outputs.cache_path }}
key: ${{ inputs.cache-key }}-${{ steps.run.outputs.cache_week }}-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ inputs.cache-key }}-${{ steps.run.outputs.cache_week }}-
# we don't want them on CI
- name: Clean test and fuzz caches
run: go clean -testcache -fuzzcache
shell: bash