1919
2020jobs :
2121 unit-tests-mac :
22- # The CMake configure and build commands are platform agnostic and should work equally
23- # well on Windows or Mac. You can convert this to a matrix build if you need
24- # cross-platform coverage.
25- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
26-
2722 runs-on : macos-latest
2823 steps :
2924 - uses : actions/checkout@v4
3025
3126 - name : Create Build Environment
32- # Some projects don't allow in-source building, so create a separate build directory
33- # We'll use this as our working directory for all subsequent commands
3427 run : cmake -E make_directory ${{github.workspace}}/build
3528
3629 - name : Python Setup
@@ -55,34 +48,21 @@ jobs:
5548 restore-keys : conan-${{ runner.os }}-
5649
5750 - name : Configure CMake
58- # Use a bash shell so we can use the same syntax for environment variable
59- # access regardless of the host operating system
6051 shell : bash
6152 working-directory : ${{github.workspace}}/build
62- # Note the current convention is to use the -S and -B options here to specify source
63- # and build directories, but this is only available with CMake 3.13 and higher.
64- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
6553 run : PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
6654
6755 - name : Build
6856 working-directory : ${{github.workspace}}/build
6957 shell : bash
70- # Execute the build. You can specify a specific target with "--target <NAME>"
71- run : cmake --build . --config $BUILD_TYPE -- -j 2
58+ run : cmake --build . --config $BUILD_TYPE -- -j 4
7259
7360 - name : Test
7461 working-directory : ${{github.workspace}}/build
7562 shell : bash
76- # Execute tests defined by the CMake configuration.
77- # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
7863 run : ctest -C $BUILD_TYPE
7964
8065 unit-tests-linux :
81- # The CMake configure and build commands are platform agnostic and should work equally
82- # well on Windows or Mac. You can convert this to a matrix build if you need
83- # cross-platform coverage.
84- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
85-
8666 runs-on : ubuntu-latest
8767 outputs :
8868 version_number : ${{ env.VERSION }}
9171 - uses : actions/checkout@v4
9272
9373 - name : Create Build Environment
94- # Some projects don't allow in-source building, so create a separate build directory
95- # We'll use this as our working directory for all subsequent commands
9674 run : cmake -E make_directory ${{github.workspace}}/build
9775
9876 - name : Get Conan
@@ -101,11 +79,6 @@ jobs:
10179 with :
10280 version : 1.66.0
10381
104- - name : linux package install
105- run : |
106- sudo apt-get update
107- sudo apt-get install --yes --no-install-recommends jq
108-
10982 - name : Setup Conan Cache
11083 uses : actions/cache@v4
11184 with :
@@ -114,50 +87,34 @@ jobs:
11487 restore-keys : conan-${{ runner.os }}-
11588
11689 - name : Configure CMake
117- # Use a bash shell so we can use the same syntax for environment variable
118- # access regardless of the host operating system
11990 shell : bash
12091 working-directory : ${{github.workspace}}/build
121- # Note the current convention is to use the -S and -B options here to specify source
122- # and build directories, but this is only available with CMake 3.13 and higher.
123- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
12492 run : PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
12593
12694 - name : Get VERSION
12795 id : build
12896 run : |
12997 echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
130- echo "::set-output name=version::$(cat ${{github.workspace}}/build/VERSION)"
13198 echo "COMMIT=`git rev-parse --short HEAD`" >> $GITHUB_ENV
13299
133100 - name : Build
134101 working-directory : ${{github.workspace}}/build
135102 shell : bash
136- # Execute the build. You can specify a specific target with "--target <NAME>"
137- run : cmake --build . --config $BUILD_TYPE -- -j 2
103+ run : cmake --build . --config $BUILD_TYPE -- -j 4
138104
139105 - name : Test
140106 working-directory : ${{github.workspace}}/build
141107 shell : bash
142- # Execute tests defined by the CMake configuration.
143- # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
144108 run : sudo ctest -C $BUILD_TYPE
145109
146110 build-win64 :
147- # The CMake configure and build commands are platform agnostic and should work equally
148- # well on Windows or Mac. You can convert this to a matrix build if you need
149- # cross-platform coverage.
150- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
151-
152111 runs-on : windows-2019
153112 outputs :
154113 version_number : ${{ env.VERSION }}
155114 steps :
156115 - uses : actions/checkout@v4
157116
158117 - name : Create Build Environment
159- # Some projects don't allow in-source building, so create a separate build directory
160- # We'll use this as our working directory for all subsequent commands
161118 run : cmake -E make_directory ${{github.workspace}}\build
162119
163120 - name : Get Conan
@@ -174,13 +131,8 @@ jobs:
174131 restore-keys : conan-${{ runner.os }}-
175132
176133 - name : Configure CMake
177- # Use a bash shell so we can use the same syntax for environment variable
178- # access regardless of the host operating system
179134 shell : bash
180135 working-directory : ${{github.workspace}}\build
181- # Note the current convention is to use the -S and -B options here to specify source
182- # and build directories, but this is only available with CMake 3.13 and higher.
183- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
184136 run : PKG_CONFIG_PATH=${{github.workspace}}\local\lib\pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
185137
186138 - name : Get VERSION
@@ -193,7 +145,6 @@ jobs:
193145 - name : Build
194146 working-directory : ${{github.workspace}}\build
195147 shell : bash
196- # Execute the build. You can specify a specific target with "--target <NAME>"
197148 run : cmake --build . --config $BUILD_TYPE -- -m
198149
199150 # TODO: Fix unit tests for windows platform
@@ -310,13 +261,9 @@ jobs:
310261 id : build
311262 run : |
312263 echo "VERSION=${{needs.unit-tests-linux.outputs.version_number}}" >> $GITHUB_ENV
313- echo "::set-output name=version::$(echo env.VERSION)"
314264
315265 - name : Generate ref tag (develop)
316- run : |
317- echo "REF_TAG=latest-develop" >> $GITHUB_ENV
318- echo "PRERELEASE=true" >> $GITHUB_ENV
319- echo "DRAFT=false" >> $GITHUB_ENV
266+ run : echo "REF_TAG=latest-develop" >> $GITHUB_ENV
320267
321268 - name : Debug ref tag
322269 run : echo ${{ env.REF_TAG }}
@@ -353,18 +300,12 @@ jobs:
353300 context : .
354301 file : ./docker/Dockerfile.crashhandler
355302 platforms : linux/amd64
356- tags : ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }} , ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
303+ push : true
304+ tags : |
305+ ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }}
306+ ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
357307 outputs : type=docker,dest=/tmp/amd64.tar
358308
359- - name : Load image
360- env :
361- IMAGE_NAME : netboxlabs/pktvisor
362- run : |
363- docker load --input /tmp/amd64.tar
364- docker image ls -a
365- docker push ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
366- docker push ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }}
367-
368309 build-app-image-x64 :
369310 needs : [ package-amd64 ]
370311 runs-on : ubuntu-latest
@@ -388,20 +329,15 @@ jobs:
388329
389330 - name : Get VERSION
390331 id : build
391- run : |
392- echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
393- echo "::set-output name=version::$(cat ${{github.workspace}}/build/VERSION)"
332+ run : echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
394333
395334 - name : Debug version
396335 run : |
397336 echo ${{ env.VERSION }}
398- echo ${{ steps.build.outputs.version }}
399337
400338 - name : Generate ref tag (develop)
401339 run : |
402340 echo "REF_TAG=latest-develop" >> $GITHUB_ENV
403- echo "PRERELEASE=true" >> $GITHUB_ENV
404- echo "DRAFT=false" >> $GITHUB_ENV
405341
406342 - name : Prepare version file
407343 run : |
@@ -498,10 +434,7 @@ jobs:
498434 run : ls -lha .
499435
500436 - name : Generate ref tag (develop)
501- run : |
502- echo "REF_TAG=latest-develop" >> $GITHUB_ENV
503- echo "PRERELEASE=true" >> $GITHUB_ENV
504- echo "DRAFT=false" >> $GITHUB_ENV
437+ run : echo "REF_TAG=latest-develop" >> $GITHUB_ENV
505438
506439 - name : Debug ref tag
507440 run : echo ${{ env.REF_TAG }}
@@ -539,14 +472,8 @@ jobs:
539472 context : .
540473 file : ./docker/Dockerfile.crashhandler
541474 platforms : linux/arm64
542- tags : ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }} , ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
475+ push : true
476+ tags : |
477+ ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }}
478+ ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
543479 outputs : type=docker,dest=/tmp/arm64.tar
544-
545- - name : Load image
546- env :
547- IMAGE_NAME : netboxlabs/pktvisor
548- run : |
549- docker load --input /tmp/arm64.tar
550- docker image ls -a
551- docker push ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
552- docker push ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }}
0 commit comments