-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (39 loc) · 1.1 KB
/
apigw-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
name: APIGateway-CI
on:
workflow_dispatch:
push:
pull_request:
# develop
branches: [ main ]
jobs:
apigw-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 api-gateway
run: |
GOOS=linux GOARCH=amd64 go build -o apigw .
working-directory: api-gateway