Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 1 | name: libnetconf2 CI |
| 2 | on: |
| 3 | push: |
| 4 | branches: |
Michal Vasko | 7678c5d | 2021-05-27 10:32:13 +0200 | [diff] [blame] | 5 | - master |
| 6 | - devel |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 7 | pull_request: |
| 8 | branches: |
Michal Vasko | 7678c5d | 2021-05-27 10:32:13 +0200 | [diff] [blame] | 9 | - master |
| 10 | - devel |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 11 | |
| 12 | env: |
roman | 41a11e4 | 2022-06-22 09:27:08 +0200 | [diff] [blame] | 13 | DEFAULT_PACKAGES: libcmocka-dev zlib1g-dev libssh-dev libssl-dev libpam0g-dev |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 14 | |
| 15 | jobs: |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 16 | git-branch: |
| 17 | name: Get git branch |
| 18 | runs-on: ubuntu-18.04 |
| 19 | outputs: |
| 20 | branch-name: ${{ steps.get-git-branch.outputs.branch-name }} |
| 21 | steps: |
| 22 | - id: get-git-branch |
| 23 | run: | |
| 24 | if ${{ github.event_name == 'push' }} |
| 25 | then export GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3` |
| 26 | else |
| 27 | export GIT_BRANCH=${{ github.base_ref }} |
| 28 | fi |
| 29 | echo "::set-output name=branch-name::$GIT_BRANCH" |
| 30 | |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 31 | build: |
| 32 | name: ${{ matrix.config.name }} |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 33 | runs-on: ${{ matrix.config.os }} |
| 34 | needs: git-branch |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 35 | strategy: |
| 36 | fail-fast: false |
| 37 | matrix: |
| 38 | config: |
| 39 | - { |
| 40 | name: "Release, Ubuntu 18.04, gcc", |
| 41 | os: "ubuntu-18.04", |
| 42 | build-type: "Release", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 43 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 44 | cc: "gcc", |
Michal Vasko | 2cd7163 | 2021-06-04 12:03:12 +0200 | [diff] [blame] | 45 | options: "-DENABLE_TESTS=ON -DENABLE_DNSSEC=ON", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 46 | packages: "", |
| 47 | snaps: "", |
| 48 | make-prepend: "", |
| 49 | make-target: "" |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 50 | } |
| 51 | - { |
| 52 | name: "Release, Ubuntu 18.04, clang", |
| 53 | os: "ubuntu-18.04", |
| 54 | build-type: "Release", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 55 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 56 | cc: "clang", |
Michal Vasko | 2cd7163 | 2021-06-04 12:03:12 +0200 | [diff] [blame] | 57 | options: "-DENABLE_TESTS=ON -DENABLE_DNSSEC=ON", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 58 | packages: "", |
| 59 | snaps: "", |
| 60 | make-prepend: "", |
| 61 | make-target: "" |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 62 | } |
| 63 | - { |
| 64 | name: "Debug, Ubuntu 18.04, gcc", |
| 65 | os: "ubuntu-18.04", |
| 66 | build-type: "Debug", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 67 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 68 | cc: "gcc", |
Michal Vasko | 885f60b | 2021-05-28 11:15:15 +0200 | [diff] [blame] | 69 | options: "-DENABLE_DNSSEC=ON", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 70 | packages: "valgrind", |
| 71 | snaps: "", |
| 72 | make-prepend: "", |
| 73 | make-target: "" |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 74 | } |
| 75 | - { |
| 76 | name: "Debug, Ubuntu 18.04, clang", |
| 77 | os: "ubuntu-18.04", |
| 78 | build-type: "Debug", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 79 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 80 | cc: "clang", |
Michal Vasko | 885f60b | 2021-05-28 11:15:15 +0200 | [diff] [blame] | 81 | options: "-DENABLE_DNSSEC=ON", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 82 | packages: "valgrind", |
| 83 | snaps: "", |
| 84 | make-prepend: "", |
| 85 | make-target: "" |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 86 | } |
| 87 | - { |
roman | 6a8947b | 2022-07-21 11:31:44 +0200 | [diff] [blame] | 88 | name: "SSH Only, Ubuntu 22.04", |
| 89 | os: "ubuntu-22.04", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 90 | build-type: "Debug", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 91 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 92 | cc: "gcc", |
Michal Vasko | 885f60b | 2021-05-28 11:15:15 +0200 | [diff] [blame] | 93 | options: "-DENABLE_TLS=OFF -DENABLE_SSH=ON", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 94 | packages: "valgrind", |
| 95 | snaps: "", |
| 96 | make-prepend: "", |
| 97 | make-target: "" |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 98 | } |
| 99 | - { |
| 100 | name: "TLS Only", |
| 101 | os: "ubuntu-18.04", |
| 102 | build-type: "Debug", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 103 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 104 | cc: "gcc", |
Michal Vasko | 885f60b | 2021-05-28 11:15:15 +0200 | [diff] [blame] | 105 | options: "-DENABLE_TLS=ON -DENABLE_SSH=OFF", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 106 | packages: "valgrind", |
| 107 | snaps: "", |
| 108 | make-prepend: "", |
| 109 | make-target: "" |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 110 | } |
| 111 | - { |
| 112 | name: "No SSH nor TLS", |
| 113 | os: "ubuntu-18.04", |
| 114 | build-type: "Debug", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 115 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 116 | cc: "gcc", |
Michal Vasko | 885f60b | 2021-05-28 11:15:15 +0200 | [diff] [blame] | 117 | options: "-DENABLE_TLS=OFF -DENABLE_SSH=OFF", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 118 | packages: "valgrind", |
| 119 | snaps: "", |
| 120 | make-prepend: "", |
| 121 | make-target: "" |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 122 | } |
| 123 | - { |
| 124 | name: "ASAN and UBSAN", |
| 125 | os: "ubuntu-18.04", |
| 126 | build-type: "Debug", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 127 | dep-build-type: "Release", |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 128 | cc: "clang", |
| 129 | options: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DENABLE_VALGRIND_TESTS=OFF", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 130 | packages: "", |
| 131 | snaps: "", |
| 132 | make-prepend: "", |
| 133 | make-target: "" |
| 134 | } |
| 135 | - { |
| 136 | name: "ABI Check", |
roman | 6a8947b | 2022-07-21 11:31:44 +0200 | [diff] [blame] | 137 | os: "ubuntu-18.04", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 138 | build-type: "ABICheck", |
| 139 | dep-build-type: "Debug", |
| 140 | cc: "gcc", |
| 141 | options: "", |
Michal Vasko | e53d260 | 2021-07-26 10:19:30 +0200 | [diff] [blame] | 142 | packages: "abi-dumper abi-compliance-checker snap", |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 143 | snaps: "core universal-ctags", |
| 144 | make-prepend: "", |
| 145 | make-target: "abi-check" |
| 146 | } |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 147 | |
| 148 | steps: |
| 149 | - uses: actions/checkout@v2 |
| 150 | |
roman | 6a8947b | 2022-07-21 11:31:44 +0200 | [diff] [blame] | 151 | - name: libssh 0.7 repo |
| 152 | if: matrix.config.os == 'ubuntu-18.04' || matrix.config.os == 'ubuntu-20.04' |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 153 | shell: bash |
| 154 | run: | |
| 155 | sudo add-apt-repository ppa:kedazo/libssh-0.7.x -y |
roman | 6a8947b | 2022-07-21 11:31:44 +0200 | [diff] [blame] | 156 | |
| 157 | - name: Deps-packages |
| 158 | shell: bash |
| 159 | run: | |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 160 | sudo apt-get update |
| 161 | sudo apt-get install $DEFAULT_PACKAGES ${{ matrix.config.packages }} |
| 162 | if ${{ matrix.config.snaps != '' }} |
Michal Vasko | e53d260 | 2021-07-26 10:19:30 +0200 | [diff] [blame] | 163 | then sudo snap refresh; sudo snap install ${{ matrix.config.snaps }} |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 164 | fi |
| 165 | |
| 166 | - name: Deps-uncrustify |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 167 | shell: bash |
| 168 | working-directory: ${{ github.workspace }} |
| 169 | run: | |
| 170 | git clone --branch uncrustify-0.71.0 https://github.com/uncrustify/uncrustify |
| 171 | cd uncrustify |
| 172 | mkdir build |
| 173 | cd build |
| 174 | CC=${{ matrix.config.cc }} cmake .. |
| 175 | make |
| 176 | sudo make install |
| 177 | if: ${{ matrix.config.name == 'Debug, Ubuntu 18.04, gcc' }} |
| 178 | |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 179 | - name: Deps-libyang |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 180 | shell: bash |
| 181 | run: | |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 182 | git clone -b ${{needs.git-branch.outputs.branch-name}} https://github.com/CESNET/libyang.git |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 183 | cd libyang |
| 184 | mkdir build |
| 185 | cd build |
Michal Vasko | e229828 | 2021-11-12 15:36:24 +0100 | [diff] [blame] | 186 | CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.dep-build-type }} -DENABLE_TESTS=OFF .. |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 187 | make -j2 |
| 188 | sudo make install |
| 189 | |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 190 | - name: Deps-libval |
| 191 | shell: bash |
| 192 | run: | |
Michal Vasko | 29721a8 | 2021-05-26 12:05:08 +0200 | [diff] [blame] | 193 | git clone https://github.com/DNSSEC-Tools/DNSSEC-Tools.git dnssec-tools |
| 194 | cd dnssec-tools/dnssec-tools/validator |
| 195 | ./configure |
| 196 | make -j2 |
| 197 | sudo make install |
| 198 | |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 199 | - name: Configure |
| 200 | shell: bash |
| 201 | working-directory: ${{ github.workspace }} |
| 202 | run: | |
| 203 | mkdir build |
| 204 | cd build |
Michal Vasko | 885f60b | 2021-05-28 11:15:15 +0200 | [diff] [blame] | 205 | CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} ${{ matrix.config.options }} .. |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 206 | |
| 207 | - name: Build |
| 208 | shell: bash |
| 209 | working-directory: ${{ github.workspace }}/build |
Michal Vasko | 0ddf5f7 | 2021-05-28 11:06:34 +0200 | [diff] [blame] | 210 | run: | |
| 211 | export LC_ALL=C.UTF-8 |
| 212 | export PATH=/snap/bin:${{ github.workspace }}/coverity-tools/bin:$PATH |
| 213 | ${{ matrix.config.make-prepend }} make ${{ matrix.config.make-target }} |
Michal Vasko | 5f861fe | 2021-05-26 10:55:04 +0200 | [diff] [blame] | 214 | |
| 215 | - name: Test |
| 216 | shell: bash |
| 217 | working-directory: ${{ github.workspace }}/build |
roman | 6a8947b | 2022-07-21 11:31:44 +0200 | [diff] [blame] | 218 | run: | |
| 219 | export LSAN_OPTIONS=suppressions=${{ github.workspace }}/tests/library_lsan.supp |
| 220 | ctest --output-on-failure |