SlideShare a Scribd company logo
Gitlab
Creating C++ applications with Gitlab CI
Navigate : Space / Arrow Keys | - Menu | - Fullscreen | - Overview | - Blackout | - Speaker | - HelpM F O B S ?

1 / 45
Hello!
Uilian Ries
C++ and Python Developer
Work at @khomp
@uilianries
  
@uilianries

2 / 45
@uilianries

3 / 45
RISE OF THE FOX
@uilianries

4 / 45
@uilianries

5 / 45
GITLAB
GitLab is a web-based Git-repository manager with
wiki, issue-tracking and CI/CD pipeline features.
@uilianries

6 / 45
GITLAB CI
@uilianries

7 / 45
ARCHITECTURE
GitLab CI/CD manages projects/builds
GitLab Runner is an application which processes
builds
You need at least one GitLab instance and one
GitLab Runner.
@uilianries

8 / 45
ARCHITECTURE
@uilianries

9 / 45
GITLAB RUNNER
GitLab Runner preforms the actual build
It can run on any platform
It can test any programming language
Support Docker, including auto scaling and
multiple jobs concurrently
@uilianries

10 / 45
PIPELINE
@uilianries

11 / 45
CONFIGURATION FILE
.gitlab-ci.yml
YAML format
Add le to the root directory of your repository
Con gure a Runner
@uilianries

12 / 45
Cppcheck
Clang Tidy
Doxygen
Unit Test (Catch2)
Generate .DEB package
Let's start a new C++ project!
What does it need?
@uilianries

13 / 45
├── CMakeLists.txt
├── conanfile.txt
├── docs
│ ├── Doxyfile
├── include
│ └── hello
│ └── hello.hpp
├── lib
│ └── hello.cpp
└── test
├── CMakeLists.txt
└── test_message.cpp
@uilianries

14 / 45
CPPCHECK
A static code analysis tool for the C and C++
$ cppcheck *.cpp --enable=all --language=c++
@uilianries

15 / 45
CPPCHECK
.gitlab-ci.yml
cppcheck:
image: ubuntu:bionic
before_script:
- apt update
- apt install -y --no-install-recommends cppcheck=1.82-1
- cppcheck --version
script:
- cppcheck lib/*.cpp --verbose --enable=all --inconclusive --
@uilianries

16 / 45
Video Disabled
@uilianries

17 / 45
CLANG TIDY
A clang-based C++ “linter” tool
$ clang-tidy test.cpp -checks=-*,clang-analyz
@uilianries

18 / 45
CLANG TIDY
.gitlab-ci.yml
clang-tidy:
image: base/archlinux:2018.09.01
variables:
CC: clang
CXX: clang++
before_script:
- pacman -Syu --needed --noconfirm clang-tools-extra=6.0.1-2
- clang-tidy --version
script:
- clang-tidy -warnings-as-errors="*" -checks="-*,clang-analyz
@uilianries

19 / 45
Video Disabled
@uilianries

20 / 45
DOXYGEN
A documentation generator, a tool for writing
software reference documentation
$ doxygen docs/Doxyfile
@uilianries

21 / 45
DOXYGEN
.gitlab-ci.yml
doxygen:
image: alpine:3.7
before_script:
- apk update
- apk add --no-cache -t .required_apks doxygen=1.8.13-r1 gra
- mkdir -p build/docs
script:
- doxygen docs/Doxyfile
artifacts:
paths:
- build/docs/html/
@uilianries

22 / 45
Video Disabled
@uilianries

23 / 45
DOXYGEN
@uilianries

24 / 45
STAGES
[x] Analysis [ ] Testing [ ] Deployment
@uilianries

25 / 45
BUILDING
CMake
Conan
Gcc
Clang
@uilianries

26 / 45
TESTING
Catch2
Valgrind
gcovr
@uilianries

27 / 45
CMake + Conan + Catch2
A application for managing the build process of
software
A C and C++ Package Manager for Developers
A modern header-only, test framework for unit-
tests
@uilianries

28 / 45
HOW TO BUILD
$ mkdir build && cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF
$ cmake --build .
@uilianries

29 / 45
ADDING TESTS
$ mkdir build && cd build
$ conan install ..
$ cmake .. -DCMAKE_BUILD_TYPE=Debug
$ cmake --build . --target test
$ cmake --build . --target memcheck
$ cmake --build . --target coverage
@uilianries

30 / 45
build-gcc7:
image: lasote/conangcc7
before_script:
- sudo apt update
- sudo apt install gcovr
script:
- mkdir -p build && cd build
- conan install ..
- cmake ..
- cmake --build .
- cmake --build . --target test
- cmake --build . --target memcheck
- cmake --build . --target coverage
@uilianries

31 / 45
Video Disabled
@uilianries

32 / 45
CODE COVERAGE
Add code coverage result for Download
@uilianries

33 / 45
build-gcc7:
image: lasote/conangcc7
before_script:
- sudo apt update
- sudo apt install gcovr
script:
- mkdir -p build && cd build
- conan install ..
- cmake ..
- cmake --build .
- cmake --build . --target test
- cmake --build . --target memcheck
- cmake --build . --target coverage
artifacts:
paths:
build/coverage/
@uilianries

34 / 45
COVERAGE
@uilianries

35 / 45
STAGES
[X] Analysis [X] Testing [ ] Deployment
@uilianries

36 / 45
DEPLOYING
Download the project as a package
Use CPack to generate .DEB package
Upload package to Bintray
@uilianries

37 / 45
Bintray o ers native support for all major
package formats
@uilianries

38 / 45
deploy-bintray:
image: lasote/conangcc7
before_script:
- sudo apt update
- sudo apt install -y --no-install-recommends curl
script:
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF
- cmake --build .
- cpack -G DEB .
after_script:
- curl -T build/hello-0.1.0.deb -uuilianries:${BINTRAY_API_
artifacts:
paths:
- build/*.deb
@uilianries

39 / 45
Video Disabled
@uilianries

40 / 45
@uilianries

41 / 45
DEMO
@uilianries

42 / 45
CONCLUSION
C and C++ is not just about language standard
There are a lot of FOSS tools
Gitlab is a good opportunity to standardize your
environment
@uilianries

43 / 45
REFERENCES
https://gitlab.com/uilianries/native- oripa
https://bintray.com/uilianries/dpkg/hello
https://github.com/conan-io/conan
https://github.com/bincrafters/conan-catch2
https://docs.gitlab.com/ee/ci/yaml
@uilianries

44 / 45
THANK YOU!
Questions ?
You can nd me on:
@uilianries - twitter, github
cpplang.slack.com - channel #conan or
#bincrafters
uilianries@gmail.com
https://conan.io
@uilianries

45 / 45

More Related Content

PDF
Android Multimedia Framework
PDF
Devops Porto - CI/CD at Gitlab
PDF
Get started with gitops and flux
PDF
Continuous Integration/Deployment with Gitlab CI
PDF
Gitlab flow solo
PDF
Jenkins vs GitLab CI
PDF
Accessing Hardware on Android
PDF
Introduction to GitHub Actions
Android Multimedia Framework
Devops Porto - CI/CD at Gitlab
Get started with gitops and flux
Continuous Integration/Deployment with Gitlab CI
Gitlab flow solo
Jenkins vs GitLab CI
Accessing Hardware on Android
Introduction to GitHub Actions

What's hot (20)

PPTX
Overview of Android binder IPC implementation
PDF
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
PDF
Gitlab ci-cd
PPTX
Android AIDL Concept
PDF
Introduction to Embedded System
PDF
Conan.io - The C/C++ package manager for Developers
PPT
Behavior Driven Development (BDD) and Agile Testing
PDF
Automation with ansible
PPTX
Docker para integradores Asterisk
PDF
Understanding the Android System Server
PDF
Ninja Build: Simple Guide for Beginners
PDF
淺談探索 Linux 系統設計之道
PDF
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
PPTX
GIT presentation
PPTX
GCCP Session #1 - Getting Started with GCP.pptx
PDF
QEMU in Cross building
PPTX
Xhacker firebase
PDF
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
PDF
Systemd for developers
PPTX
Basic Jenkins Guide.pptx
Overview of Android binder IPC implementation
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Gitlab ci-cd
Android AIDL Concept
Introduction to Embedded System
Conan.io - The C/C++ package manager for Developers
Behavior Driven Development (BDD) and Agile Testing
Automation with ansible
Docker para integradores Asterisk
Understanding the Android System Server
Ninja Build: Simple Guide for Beginners
淺談探索 Linux 系統設計之道
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
GIT presentation
GCCP Session #1 - Getting Started with GCP.pptx
QEMU in Cross building
Xhacker firebase
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
Systemd for developers
Basic Jenkins Guide.pptx
Ad

Similar to Gitlab - Creating C++ applications with Gitlab CI (20)

PDF
Павел Филонов, Разделяй и управляй вместе с Conan.io
PDF
Meetup C++ Floripa - Conan.io
PDF
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
PDF
CMake best practices
PDF
Whats_new_Conan 2_0_MeetingC++7557.pdf
PDF
CMake: Improving Software Quality and Process
ODP
Introducing cvm...
PDF
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
PPTX
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
PDF
An Introduction to CMake
 
PDF
Cmake kitware
PPTX
Autotools pratical training
PDF
cmake.pdf
PDF
Conan a C/C++ Package Manager
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PDF
PVS-Studio in the Clouds: Travis CI
PDF
Gitlab ci, cncf.sk
PDF
GNU Compiler Collection - August 2005
PDF
CMake_Tutorial.pdf
PDF
Semi-Automatic Code Cleanup with Clang-Tidy
Павел Филонов, Разделяй и управляй вместе с Conan.io
Meetup C++ Floripa - Conan.io
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
CMake best practices
Whats_new_Conan 2_0_MeetingC++7557.pdf
CMake: Improving Software Quality and Process
Introducing cvm...
Embedded Systems: Lecture 13: Introduction to GNU Toolchain (Build Tools)
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
An Introduction to CMake
 
Cmake kitware
Autotools pratical training
cmake.pdf
Conan a C/C++ Package Manager
Dependencies Managers in C/C++. Using stdcpp 2014
PVS-Studio in the Clouds: Travis CI
Gitlab ci, cncf.sk
GNU Compiler Collection - August 2005
CMake_Tutorial.pdf
Semi-Automatic Code Cleanup with Clang-Tidy
Ad

More from Uilian Ries (8)

PDF
Git Workflow
PDF
BDD em Ação
PDF
Poco Bibliotecas C++
PDF
Software Development Tools for C/C++
PDF
Testes Unitários com GTest e Catch
PDF
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
PPTX
Elements of C++11
PPT
Unisinos - Proposta TCC 2015
Git Workflow
BDD em Ação
Poco Bibliotecas C++
Software Development Tools for C/C++
Testes Unitários com GTest e Catch
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
Elements of C++11
Unisinos - Proposta TCC 2015

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Introduction to Artificial Intelligence
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Digital Strategies for Manufacturing Companies
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
history of c programming in notes for students .pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Navsoft: AI-Powered Business Solutions & Custom Software Development
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Introduction to Artificial Intelligence
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PTS Company Brochure 2025 (1).pdf.......
Odoo POS Development Services by CandidRoot Solutions
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Digital Strategies for Manufacturing Companies
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
How Creative Agencies Leverage Project Management Software.pdf
Transform Your Business with a Software ERP System
history of c programming in notes for students .pptx
top salesforce developer skills in 2025.pdf
Softaken Excel to vCard Converter Software.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...

Gitlab - Creating C++ applications with Gitlab CI