mbusd/.gitlab-ci.yml
NickMa fb3d6d6489 Cmake gitlabci (#25)
* gitlabci: hardcoded the debian systemd path

* cmake: no failure on forced SYSTEMD_SERVICES_INSTALL_DIR

* gitlabci: added fedora target

* gitlabci: added fedora package

* gitlabci: added another fedora package

* gitlabci: fedora changed rpmbuilder

* fedora...

* fedora package name try4

* rpmdevtools detection

* gitlabci: changed rpm detection

* gitlabci: rpmbuilder detection

* rpmbuilder added references

* gitlabci: changed the expiration timespan to 6months

* removed always false comparison (dbglvl is unsigned)
2018-03-05 17:19:52 +03:00

77 lines
2.0 KiB
YAML

---
stages:
- build
- test
.mbusd_job_template: &mbusd_job_template # Hidden key that defines an anchor
image: debian:stable
artifacts:
# create an archive with a name of the current stage and branch name
name: "${CI_BUILD_STAGE}_${CI_BUILD_REF_NAME}"
expire_in: 6 months
paths:
- output.dir/mbusd
- output.dir/mbusd.8
- conf/mbusd.conf.example
- output.dir/mbusd@.service
- output.dir/mbusd*.deb
- output.dir/mbusd*.rpm
build:fedora_x86:
<<: *mbusd_job_template
image: fedora:latest
stage: build
before_script:
- yum -y install cmake pkgconfig gcc-c++ rpmdevtools
script:
- mkdir output.dir/
- cd output.dir
- cmake -D CMAKE_BUILD_TYPE=Debug -DSYSTEMD_SERVICES_INSTALL_DIR=/usr/lib/systemd/system ../
- make package
build:deb_armhf:
<<: *mbusd_job_template
stage: build
before_script:
- apt update -qq
- apt install -y -qq build-essential pkg-config cmake gcc-arm-linux-gnueabihf
script:
- mkdir output.dir/
- cd output.dir
- cmake -DCMAKE_BUILD_TYPE=Release -DSYSTEMD_SERVICES_INSTALL_DIR=/lib/systemd/system -DCMAKE_TOOLCHAIN_FILE=../cmake/arm_linux_gnueabihf.cmake ../
- make package
build:deb_x86:
<<: *mbusd_job_template
stage: build
before_script:
- apt update -qq
- apt install -y -qq build-essential pkg-config cmake
script:
- mkdir output.dir/
- cd output.dir
- cmake -DCMAKE_BUILD_TYPE=Release -DSYSTEMD_SERVICES_INSTALL_DIR=/lib/systemd/system ../
- make package
test_x86:
stage: test
image: debian:stable
#https://forum.gitlab.com/t/testing-copy-yaml-file-to-build-folder/8309
before_script:
- apt update -qq
- apt install -y -qq build-essential pkg-config cmake
- apt install -y -qq python-dev python-pip python-setuptools socat
- python -m pip install pymodbus service_identity
dependencies:
- build:deb_x86
script:
- mkdir -p output.dir/
- cd output.dir
- cmake -DTESTS=True ../
- make VERBOSE=1
# execute all tests
- ./test_*