From 0a6e3353cdc498f8737f55929fe5c7de8fee15ba Mon Sep 17 00:00:00 2001 From: Tobias Frust Date: Tue, 9 Jul 2019 10:12:12 +0200 Subject: [PATCH] Add C++ HelloWorld example and corresponding CI job --- .gitlab-ci.yml | 18 ++++++++++++++++-- src/helloworld.cpp | 6 ++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/helloworld.cpp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 42858ff..599547c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,17 @@ -hello-world: +build:gcclatest: + image: gcc:latest + stage: build script: - - echo "Hello World" + - g++ src/helloworld.cpp -o helloWorld + artifacts: + paths: + - helloWorld + +test:gcclatest: + image: gcc:latest + script: + - ls + - chmod +x helloWorld + - ./helloWorld + dependencies: + - build:gcclatest diff --git a/src/helloworld.cpp b/src/helloworld.cpp new file mode 100644 index 0000000..86bb659 --- /dev/null +++ b/src/helloworld.cpp @@ -0,0 +1,6 @@ +#include + +int main(){ + std::cout << "Hello World!" << std::endl; + return 0; +}