Commit 162d2340 authored by Heinz N. Gies's avatar Heinz N. Gies

Adds a template for running ci tests on services.

parent 07958255
### Generic cli file for services
stages:
- compile # compile and create a cache
- test # run tets
- package # verify package creation
################################################################################
## Compile stage
################################################################################
# Aa first stage we compile our code, we'll run tests on it afterwards
# this gives the advantage that we do not have to re-compile c-code over and
# over again
compile-bsd:
stage: compile
script:
- '[ "${CI_PIPELINE_SOURCE}" = "pipeline" ] && ./rebar3 upgrade ${DOWNSTREAM_LIBRARY} || true'
- ./rebar3 compile
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
untracked: true
paths:
- _build/
- rebar.lock
compile-smartos:
stage: compile
script:
- '[ "${CI_PIPELINE_SOURCE}" = "pipeline" ] && ./rebar3 upgrade ${DOWNSTREAM_LIBRARY} || true'
- ./rebar3 compile
tags:
- erlang-19
- smartos
cache:
key: "$CI_COMMIT_SHA-smartos"
untracked: true
paths:
- _build/
- rebar.lock
################################################################################
## test stage
################################################################################
# Tests consist of everything from linting to unit tests we can run them in
# paralell
lint:
stage: test
script:
- ./rebar3 as lint lint
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
xref:
stage: test
script:
- ./rebar3 xref
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
dialyzer:
stage: test
script:
- ./rebar3 dialyzer
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
eunit:
stage: test
script:
- ./rebar3 eunit
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
################################################################################
## package stage
################################################################################
# We make sure our package builds on both FreeBSD and SmartOS
bsd:
stage: package
script:
- gmake dist
tags:
- bsd
- erlang-19
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
smartos:
stage: package
script:
- gmake dist
tags:
- erlang-19
- smartos
cache:
key: "$CI_COMMIT_SHA-smartos"
policy: pull
paths:
- _build/
- rebar.lock
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment