-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (44 loc) · 1.21 KB
/
rest-ci.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
50
51
name: Rest-CI
on:
workflow_dispatch:
push:
pull_request:
# develop
branches: [ main ]
jobs:
rest-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install GO
uses: actions/setup-go@v2
with:
go-version: 1.16
# Setting cache-paths
- name: cache-paths
run: |
echo '::set-output name=build-cache::$(go env GOCACHE)'
echo '::set-output name=mod-cache::$(go env GOMODCACHE)'
id: cache-paths
# Caching go build for test
- name: Go build cache
uses: actions/cache@v2
with:
path: ${{ steps.cache-paths.outputs.build-cache }}
key: ${{ runner.os }}-build-cache-${{ hashFiles('**/go.sum') }}
# Caching go mod for build
- name: Go mod cache
uses: actions/cache@v2
with:
path: ${{ steps.cache-paths.outputs.mod-cache }}
key: ${{ runner.os }}-mod-cache-${{ hashFiles('**/go.sum') }}
- name: Build rest-api
run: |
GOOS=linux GOARCH=amd64 go build -o rest .
working-directory: rest-api
- name: Test rest-api
# go test -v ./...()
run: |
go test -v ./service
working-directory: rest-api