forked from cerbos/cerbos
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.04 KB
/
cache.yaml
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
41
42
43
44
45
46
47
48
name: Cache dependencies
on:
push:
branches:
- main
workflow_call:
jobs:
changes:
name: Check for changes
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
deps: ${{ steps.filter.outputs.deps }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Check for changes
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
deps:
- .github/workflows/cache.yaml
- "**/go.mod"
cache:
name: Cache dependencies
needs: changes
if: ${{ needs.changes.outputs.deps == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go and cache dependencies
id: setup
uses: ./.github/actions/setup-go
with:
write_deps_cache: true
write_build_cache: true
- name: Warm cache
if: ${{ steps.setup.outputs.cache_hit != 'true' }}
run: make warm-cache