-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (117 loc) · 5.66 KB
/
golang-apps-recipes.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: holon_golang_apps_recipes_workflow
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
with:
path: ./code
- name: apt update
run: sudo apt update
# Install golang
- name: Install golang 1.20.3
run: sudo rm -rf /usr/bin/go &&
sudo wget https://golang.org/dl/go1.20.3.linux-amd64.tar.gz &&
sudo mkdir /home/runner/work/go &&
sudo tar -C /home/runner/work/go -xzf go1.20.3.linux-amd64.tar.gz &&
export PATH=$PATH:/home/runner/work/go/go/bin &&
go version
- name: dpkg / rpm prep
run: sudo apt-get install -y uuid-dev
uuid libuuid1
libaio-dev libaio1
libgcrypt20 openssl
libssl-dev python3-pip
python3-setuptools `apt-cache search librocksdb | awk '{print $1}'` uncrustify libasan5 libtsan0
- name: Install python libraries
run: pip3 install setuptools wheel func_timeout sockets psutil dpath jmespath
# Install Ansible
- name: Install Ansible
run: pip3 install ansible
- name: make
run: cd ./code &&
./prepare.sh &&
./configure --prefix=/home/runner/work/niovad/niovad/build_dir/ --enable-devel &&
make clean && make && make install
env:
LD_LIBRARY_PATH: /home/runner/work/niovad/niovad/build_dir/lib
- name: Build go applications using makefile
run: export PATH=$PATH:/home/runner/work/go/go/bin &&
cd code/go/pumiceDB/examples/niovaKV && make -e DIR=/home/runner/work/niovad/niovad/build_dir
- name: Copy script to run recipes
run: cp ./code/scripts/run-recipes.sh /home/runner/work/niovad/niovad/build_dir/ &&
cp ./code/scripts/niovakv_recipes.txt /home/runner/work/niovad/niovad/build_dir/ &&
cp ./code/scripts/covid_app_recipe.txt ./code/scripts/foodpalaceapp_recipe.txt /home/runner/work/niovad/niovad/build_dir/
- name: Checkout repository
uses: actions/checkout@v2
with:
repository: 00pauln00/holon
#ref:
token: ${{ secrets.HOLON_NIOVA_CI_21_12_2020 }} # 'GitHub_PAT' is a secret that contains your PAT
path: ./holon
- name: Copy holon repo
run: cp -r ./holon /home/runner/work/niovad/niovad/build_dir/
- name: Create log directory for storing holon logs
run: mkdir /home/runner/work/niovad/niovad/holon_log
- name: List build directory
run: ls -l /home/runner/work/niovad/niovad/build_dir
- name: Create dir for cover data counters, metadata to be placed
run: mkdir /home/runner/work/niovad/niovad/code_cov &&
export GOCOVERDIR=/home/runner/work/niovad/niovad/code_cov
- name: run recipe for covid application
run: export GOCOVERDIR=/home/runner/work/niovad/niovad/code_cov &&
cd /home/runner/work/niovad/niovad/build_dir/holon/ &&
../run-recipes.sh '/home/runner/work/niovad/niovad/build_dir/holon'
'/home/runner/work/niovad/niovad/build_dir'
'/home/runner/work/niovad/niovad/holon_log' 5
'/home/runner/work/niovad/niovad/build_dir/covid_app_recipe.txt'
'covid'
'0'
'0'
'/home/runner/work/go/go/bin'
- name: run recipe for foodpalace application
run: export GOCOVERDIR=/home/runner/work/niovad/niovad/code_cov &&
cd /home/runner/work/niovad/niovad/build_dir/holon/ &&
../run-recipes.sh '/home/runner/work/niovad/niovad/build_dir/holon'
'/home/runner/work/niovad/niovad/build_dir'
'/home/runner/work/niovad/niovad/holon_log' 5
'/home/runner/work/niovad/niovad/build_dir/foodpalaceapp_recipe.txt'
'foodpalace'
'0'
'0'
'/home/runner/work/go/go/bin'
- name: run recipes for niovakv application
run: export GOCOVERDIR=/home/runner/work/niovad/niovad/code_cov &&
cd /home/runner/work/niovad/niovad/build_dir/holon/ &&
../run-recipes.sh '/home/runner/work/niovad/niovad/build_dir/holon'
'/home/runner/work/niovad/niovad/build_dir'
'/home/runner/work/niovad/niovad/holon_log' 5
'/home/runner/work/niovad/niovad/build_dir/niovakv_recipes.txt'
'niovakv'
'0'
'0'
'/home/runner/work/go/go/bin'
- name: Run go covdata tool to generate code cover report
run: cd /home/runner/work/niovad/niovad/code_cov &&
export PATH=$PATH:/home/runner/work/go/go/bin &&
echo "***** Code Coverage Report *****" &&
go tool covdata percent -i=./ &&
echo "***** End *****"
- name: Prepare artifact filename
id: prepare_artifact_filename
run: |
echo ::set-output name=ARTIFACT_NAME::test-recipe-report_${{ github.event.pull_request.head.sha }}_${{ github.run_attempt }}
if: failure()
- name: Archive the test results
uses: actions/upload-artifact@v2
with:
name: ${{ steps.prepare_artifact_filename.outputs.ARTIFACT_NAME }}
path: /home/runner/work/niovad/niovad/holon_log
if: failure()