Skip to content

helloworld c++, bazel, googletest, debian packaging, github actions

License

Notifications You must be signed in to change notification settings

sena-otus/dz-1-bazel

Repository files navigation

helloworld c++, bazel, debian packaging, googletest, github actions

Description

Project example with classic helloworld c++ application using bazel build system and github actions

  • generate version.h from version.h.in using bazel
  • debian package generation using bazel rules_pkg
  • googletest example
  • use github actions to build and release debian package on each push

Build instruction

  • On first checkout run "./update-patch-version.sh 1" to generate patch-version file (version/PATCH_VERSION.bzl).
  • You will need fresh bazel binary to build that. The version which comes with Debian 12 or Ubuntu 22 is outdated and will not work.
    • To install bazel localy on your Debian/Ubuntu use google repo like described here or here
    • To install for github actions, use actions-setup-bazel
  • First steps with bazel:
    • To get available targets run bazel query ...
    • To build selected target run bazel build <target>, for example
      • to build debian package run bazel build //pkg:helloworld-debian
      • to run all tests run bazel test //...