-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.14 KB
/
Copy pathtest.yml
File metadata and controls
56 lines (47 loc) · 1.14 KB
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
50
51
52
53
54
55
56
name: Test
on:
push:
branches:
- main
paths:
- 'pkg/**'
- '.github/**'
- 'proto/**'
env:
cache-version: v1
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Before cache
run: |
mkdir -p ~/go/pkg/mod
ls ~/go/pkg/
- name: Cache dependencies
uses: actions/cache@v3
id: cache-go
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: After cache
run: |
echo "-->${{steps.cache-go.outputs.cache-hit}}<--"
- name: Get dependencies
if: steps.cache-go.outputs.cache-hit != 'true'
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Test
run: make test