-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.2 KB
/
pipeline.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: Build
on: [push]
jobs:
Pipeline:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Setup Go
- uses: actions/setup-go@v3
with:
go-version: '^1.20.0'
# Get values for cache paths to be used in later steps
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
# Checkout the latest code
- name: Checkout
uses: actions/checkout@v2
# Cache go build cache, used to speedup go test
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
# Mount testbin cache
- name: Mount testbin cache
uses: actions/cache@v2
with:
path: "./testbin"
key: testbin
# Run Go Lint
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
# Run go tests
- name: Run Go Tests
run: go test ./... -coverprofile cover.out -timeout 10s
# Run go build
- name: Run Go Build
run: go build ./cache && go build ./persist