Skip to content

Commit 2709e29

Browse files
committed
actions UPDATE build DEB package
1 parent bda4e65 commit 2709e29

File tree

1 file changed

+51
-15
lines changed

1 file changed

+51
-15
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,23 @@ jobs:
9797
make-prepend: "",
9898
make-target: ""
9999
}
100+
- {
101+
name: "DEB Package",
102+
os: "ubuntu-22.04",
103+
build-type: "Release",
104+
dep-build-type: "Release",
105+
cc: "gcc",
106+
options: "",
107+
packages: "cmake debhelper valgrind python3-pip",
108+
snaps: "",
109+
make-prepend: "",
110+
make-target: ""
111+
}
100112

101113
steps:
102114
- uses: actions/checkout@main
115+
with:
116+
fetch-depth: 100
103117

104118
- name: Deps-packages
105119
shell: bash
@@ -109,6 +123,10 @@ jobs:
109123
if ${{ matrix.config.snaps != '' }}
110124
then sudo snap install ${{ matrix.config.snaps }}
111125
fi
126+
if ${{ matrix.config.name == 'DEB Package' }}; then
127+
pip install apkg
128+
apkg system-setup
129+
fi
112130
113131
- name: Deps-uncrustify
114132
shell: bash
@@ -128,33 +146,48 @@ jobs:
128146
run: |
129147
git clone -b ${{ needs.git-branch.outputs.branch-name }} https://github.com/CESNET/libyang.git
130148
cd libyang
131-
mkdir build
132-
cd build
133-
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.dep-build-type }} -DENABLE_TESTS=OFF ..
134-
make -j2
135-
sudo make install
149+
if ${{ matrix.config.name == 'DEB Package' }}; then
150+
apkg build
151+
apkg install
152+
else
153+
mkdir build
154+
cd build
155+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.dep-build-type }} -DENABLE_TESTS=OFF ..
156+
make -j2
157+
sudo make install
158+
fi
136159
137160
- name: Deps-sysrepo
138161
shell: bash
139162
run: |
140163
git clone -b ${{ needs.git-branch.outputs.branch-name }} https://github.com/sysrepo/sysrepo.git
141164
cd sysrepo
142-
mkdir build
143-
cd build
144-
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DSYSREPO_SUPERUSER_UID=`id -u` -DENABLE_TESTS=OFF ..
145-
make -j2
146-
sudo make install
165+
if ${{ matrix.config.name == 'DEB Package' }}; then
166+
apkg build
167+
apkg install
168+
else
169+
mkdir build
170+
cd build
171+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DSYSREPO_SUPERUSER_UID=`id -u` -DENABLE_TESTS=OFF ..
172+
make -j2
173+
sudo make install
174+
fi
147175
148176
- name: Deps-libnetconf2
149177
shell: bash
150178
run: |
151179
git clone -b ${{ needs.git-branch.outputs.branch-name }} https://github.com/CESNET/libnetconf2.git
152180
cd libnetconf2
153-
mkdir build
154-
cd build
155-
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_TESTS=OFF ..
156-
make -j2
157-
sudo make install
181+
if ${{ matrix.config.name == 'DEB Package' }}; then
182+
apkg build
183+
apkg install
184+
else
185+
mkdir build
186+
cd build
187+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} -DENABLE_TESTS=OFF ..
188+
make -j2
189+
sudo make install
190+
fi
158191
159192
- name: Deps-update-ld-cache
160193
shell: bash
@@ -167,6 +200,7 @@ jobs:
167200
mkdir build
168201
cd build
169202
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} ${{ matrix.config.options }} ..
203+
if: ${{ matrix.config.name != 'DEB Package' }}
170204

171205
- name: Build
172206
shell: bash
@@ -175,8 +209,10 @@ jobs:
175209
export LC_ALL=C.UTF-8
176210
export PATH=/snap/bin:${{ github.workspace }}/coverity-tools/bin:$PATH
177211
${{ matrix.config.make-prepend }} make ${{ matrix.config.make-target }}
212+
if: ${{ matrix.config.name != 'DEB Package' }}
178213

179214
- name: Test
180215
shell: bash
181216
working-directory: ${{ github.workspace }}/build
182217
run: ctest --output-on-failure -j4
218+
if: ${{ matrix.config.name != 'DEB Package' }}

0 commit comments

Comments
 (0)