-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (61 loc) · 1.76 KB
/
build-and-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
54
55
56
57
58
59
60
61
62
name: Run Tests
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Install dependencies
run: go get .
- name: Build OS X Binary
run: GOOS=darwin GOARCH=amd64 go build -o cbdinocluster-darwin
- name: Build Linux Binary
run: GOOS=linux GOARCH=amd64 go build -o cbdinocluster-linux
- name: Build Windows Binary
run: GOOS=windows GOARCH=amd64 go build -o cbdinocluster-windows.exe
- uses: actions/upload-artifact@v3
with:
name: cbdinocluster-darwin
path: cbdinocluster-darwin
- uses: actions/upload-artifact@v3
with:
name: cbdinocluster-linux
path: cbdinocluster-linux
- uses: actions/upload-artifact@v3
with:
name: cbdinocluster-windows.exe
path: cbdinocluster-windows.exe
test:
name: Integration Test
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name: cbdinocluster-linux
- run: |
chmod +x cbdinocluster-linux
./cbdinocluster-linux init --auto
- name: Setup Cluster
run: |
CBDC_ID=$(./cbdinocluster-linux allocate simple:7.0.0)
echo "CBDC_ID=$CBDC_ID" >> "$GITHUB_ENV"
- name: Run Tests
timeout-minutes: 10
run: |
./cbdinocluster-linux connstr $CBDC_ID
CBDC_MGMT=$(./cbdinocluster-linux mgmt $CBDC_ID)
echo $CBDC_MGMT
curl $CBDC_MGMT
- name: Cleanup Cluster
if: always()
run: |
./cbdinocluster-linux rm $CBDC_ID