-
Notifications
You must be signed in to change notification settings - Fork 239
49 lines (45 loc) · 1.35 KB
/
pr_push_checks_go_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
49
name: Go Cache PR Checks
on:
push:
paths:
- '**.go'
- '**.mod'
- '**.sum'
- '.github/golangci-lint.yaml'
- '.github/workflows/pr_push_checks_go.yaml'
- '.github/workflows/pr_push_checks_go_cache.yaml'
- '.github/workflows/pr_push_checks_go_lint.yaml'
concurrency:
group: pr-go-cache-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
testing_matrix:
name: Setup cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: porter-go-${{ hashFiles('**/go.sum') }}
restore-keys: porter-go-
- uses: actions/setup-go@v4
with:
cache: false
go-version-file: go.mod
- name: Download Go Modules
run: go mod download
- name: Trigger lint workflow
run: |
if [[ -n "$GITHUB_HEAD_REF" ]]; then
branch="$GITHUB_HEAD_REF"
elif [[ -n "$GITHUB_REF_NAME" ]]; then
branch="$GITHUB_REF_NAME"
fi
gh workflow run pr_push_checks_go_lint.yml -r "$branch"
gh workflow run pr_push_checks_go.yml -r "$branch"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}