-
Notifications
You must be signed in to change notification settings - Fork 73
236 lines (228 loc) · 8.88 KB
/
ci.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: Clixon CI
on:
push:
branches:
- master
- test-actions
pull_request:
branches: [ master ]
jobs:
ubuntu-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 1) checkout and compile natively (no test)
- name: install cligen
run: (git clone https://github.com/clicon/cligen.git && cd cligen && ./configure && make && sudo make install)
- name: run apt update
run: sudo apt update
- name: install dependencies
run: sudo apt install -y libssl-dev libnghttp2-dev
- name: configure
run: ./configure
- name: make
run: make -j10
- name: make install
run: sudo make install install-include
- name: make example
run: (cd example; make)
- name: install example
run: (cd example; sudo make install)
ubuntu-build-restconf-fcgi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 1) checkout and compile natively (no test)
- name: install cligen
run: (git clone https://github.com/clicon/cligen.git && cd cligen && ./configure && make && sudo make install)
- name: install dependencies
run: sudo apt install -y nginx
- name: install fcgi
run: (git clone https://github.com/FastCGI-Archives/fcgi2 && cd fcgi2 && ./autogen.sh && rm -rf .git && ./configure --prefix=/usr; make; sudo make install)
- name: configure
run: ./configure --with-restconf=fcgi
- name: make
run: make -j10
- name: make install
run: sudo make install install-include
- name: make example
run: (cd example; make)
- name: install example
run: (cd example; sudo make install)
docker-alpine-test-1:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docker/test
steps:
- uses: actions/checkout@v4
# 2) Inline of make test, but without configure
- name: in-line clone
run: git clone file://$(realpath ../..)
- name: openconfig
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
- name: yangmodels1
run: mkdir -p yang/standard
- name: yangmodels2
run: (cd yang; git init;)
- name: yangmodels3
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
- name: yangmodels4
run: (cd yang; git config core.sparseCheckout true)
- name: yangmodels5
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
- name: yangmodels6
run: (cd yang; git pull origin main)
- name: make docker
run: sudo docker build -f Dockerfile.native -t clixon/clixon-test .
- name: start container
run: ./start.sh
- name: run test a-m,p
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_a*.sh test_c*.sh test_d*.sh test_f*.sh test_h*.sh test_i*.sh test_j*.sh test_l*.sh test_m*.sh test_o*.sh" ./sum.sh'
docker-alpine-test-2:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docker/test
steps:
- uses: actions/checkout@v4
# 2) Inline of make test, but without configure
- name: in-line clone
run: git clone file://$(realpath ../..)
- name: openconfig
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
- name: yangmodels1
run: mkdir -p yang/standard
- name: yangmodels2
run: (cd yang; git init;)
- name: yangmodels3
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
- name: yangmodels4
run: (cd yang; git config core.sparseCheckout true)
- name: yangmodels5
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
- name: yangmodels6
run: (cd yang; git pull origin main)
- name: make docker
run: sudo docker build -f Dockerfile.native -t clixon/clixon-test .
- name: start container
run: ./start.sh
- name: run test n-o
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_n*.sh test_p*.sh" ./sum.sh'
docker-alpine-test-3:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docker/test
steps:
- uses: actions/checkout@v4
# 2) Inline of make test, but without configure
- name: in-line clone
run: git clone file://$(realpath ../..)
- name: openconfig
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
- name: yangmodels1
run: mkdir -p yang/standard
- name: yangmodels2
run: (cd yang; git init;)
- name: yangmodels3
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
- name: yangmodels4
run: (cd yang; git config core.sparseCheckout true)
- name: yangmodels5
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
- name: yangmodels6
run: (cd yang; git pull origin main)
- name: make docker
run: sudo docker build -f Dockerfile.native -t clixon/clixon-test .
- name: start container
run: ./start.sh
- name: run test r-y
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_r*.sh test_s*.sh test_t*.sh test_u*.sh test_w*.sh test_x*.sh test_y*.sh" ./sum.sh'
docker-alpine-test-fcgi-r:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docker/test
steps:
- uses: actions/checkout@v4
# 2) Inline of make test, but without configure
- name: in-line clone
run: git clone file://$(realpath ../..)
- name: openconfig
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
- name: yangmodels1
run: mkdir -p yang/standard
- name: yangmodels2
run: (cd yang; git init;)
- name: yangmodels3
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
- name: yangmodels4
run: (cd yang; git config core.sparseCheckout true)
- name: yangmodels5
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
- name: yangmodels6
run: (cd yang; git pull origin main)
- name: make docker fcgi
run: sudo docker build -f Dockerfile.fcgi -t clixon/clixon-test .
- name: start container
run: ./start.sh
- name: run test r-y
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_r*.sh" ./sum.sh'
reset-run-number:
runs-on: ubuntu-latest
outputs:
run-number: ${{ steps.get-build.outputs.build-number }}
steps:
- name: Get build number and reset it
id: get-build
uses: mlilback/build-number@v1
with:
base: 0 # Update this number to reset counter
run-id: ${{ github.run_number }}
create_deb_packet:
needs: reset-run-number
#if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
env:
VERSION: "7.1.0"
RUN_NUMBER: ${{ needs.reset-run-number.outputs.run-number }}
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: create dir for build
run: mkdir ${{ github.workspace }}/build
- name: Install dependencies
run: sudo apt update && sudo apt install -y build-essential flex fakeroot bison lsb-release make debhelper libnghttp2-dev libssl-dev git
- name: Clone cligen
run: git clone https://github.com/clicon/cligen.git
- name: Install cligen
run: (cd cligen; ./configure; make; sudo make install)
- name: configure
run: ./configure
- name: make
run: make
- name: install
run: sudo make install
- name: configure
run: ./configure
- name: make
run: make
- name: install
run: sudo make install DESTDIR=${{ github.workspace }}/build
- name: copy file for build deb packet dev
run: cp -r ${{ github.workspace }}/debian ${{ github.workspace }}/build
- name: add change log
run: cd ${{ github.workspace }}/build/debian && export NAME_VERSION="clixon (${{env.VERSION}}-${{env.RUN_NUMBER}})" && git --no-pager log --no-walk --encoding=utf-8 --expand-tabs=4 --pretty=format:"${NAME_VERSION} stable; urgency=medium%n%n * %w(,,2)%B%w()%n -- %an <%ae> %aD%n" > changelog && cat changelog
- name: run build packet
run: cd ${{ github.workspace }}/build && dpkg-buildpackage -us -uc
- name: show directory
run: ls -l ${{ github.workspace }}
- name: Upload artefact (clixon)
uses: actions/upload-artifact@v4
with:
name: clixon_${{env.VERSION}}-${{env.RUN_NUMBER}}_amd64.deb
path: ${{ github.workspace }}/clixon_${{env.VERSION}}-${{env.RUN_NUMBER}}_amd64.deb