-
Notifications
You must be signed in to change notification settings - Fork 26
54 lines (45 loc) · 1.78 KB
/
pr-test.yml
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
# This pipeline is to build edge sync service
name: pr-test
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
env:
IMPORT_PEFIX: github.com/open-horizon
EDGE_COMPONENT_NAME: edge-sync-service
BUILD_FLAGS: -i -tags "netgo"
LD_FLAGS: -linkmode external -extldflags -static -s -w
BUILD_OUTPUT: build
GOOS: linux
GOARCH: amd64
CGO_BUILD: 0
GOPATH: /home/runner/work/edge-sync-service/edge-sync-service/go
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: go/src/github.com/open-horizon/edge-sync-service
# prepare the environment
- name: Set up golang 1.16
uses: actions/setup-go@v2
with:
go-version: '1.16'
# build
- name: Build
shell: bash {0}
run: |
pwd
cd ${GOPATH}/src/github.com/open-horizon/edge-sync-service
mkdir -p build
./get_dependencies.sh
go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/${EDGE_COMPONENT_NAME} ${GOPATH}/src/github.com/open-horizon/edge-sync-service/cmd/${EDGE_COMPONENT_NAME}
ls -al ./${BUILD_OUTPUT}
# run coverage
./runCoverage.sh
go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/edge-sync-service-mgmt ${GOPATH}/src/github.com/open-horizon/edge-sync-service/cmd/edge-sync-service-mgmt
go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/receive-file ${GOPATH}/src/github.com/open-horizon/edge-sync-service/cmd/receive-file
go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/send-file ${GOPATH}/src/github.com/open-horizon/edge-sync-service/cmd/send-file
ls -al ./${BUILD_OUTPUT}