2022-07-19 09:08:45 +00:00
|
|
|
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
|
|
|
|
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
|
|
|
|
#
|
2021-06-28 06:07:45 +00:00
|
|
|
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
|
|
|
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
|
|
|
# This specific template is located at:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/C++.gitlab-ci.yml
|
|
|
|
|
2016-08-02 14:47:05 +00:00
|
|
|
# use the official gcc image, based on debian
|
2022-04-13 03:08:38 +00:00
|
|
|
# can use versions as well, like gcc:5.2
|
2016-08-02 14:47:05 +00:00
|
|
|
# see https://hub.docker.com/_/gcc/
|
2021-06-28 06:07:45 +00:00
|
|
|
|
2016-08-02 14:47:05 +00:00
|
|
|
image: gcc
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
# instead of calling g++ directly you can also use some build toolkit like make
|
|
|
|
# install the necessary build tools when needed
|
2019-03-07 13:57:16 +00:00
|
|
|
# before_script:
|
|
|
|
# - apt update && apt -y install make autoconf
|
|
|
|
script:
|
2016-08-02 14:47:05 +00:00
|
|
|
- g++ helloworld.cpp -o mybinary
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- mybinary
|
2019-06-05 16:31:35 +00:00
|
|
|
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
|
|
|
|
# cache:
|
|
|
|
# paths:
|
|
|
|
# - "*.o"
|
2016-08-02 14:47:05 +00:00
|
|
|
|
|
|
|
# run tests using the binary built before
|
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- ./runmytests.sh
|
2022-10-14 09:09:13 +00:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
stage: deploy
|
|
|
|
script: echo "Define your deployment script!"
|
|
|
|
environment: production
|