Files
lutim/.gitlab-ci.yml
T
Luc Didry 1142006456 👷 — Improve CI
- Refactor .gitlab-ci.yml
- Update Makefile
- Introduce junit test output
- Improve minion test
2021-01-15 07:55:57 +01:00

154 lines
3.5 KiB
YAML

image: hatsoftwares/lutim-test-ci:latest
stages:
- publish_changelog
- pouet_it
- podcheck
- carton
- carton_bdd
- tests
- cover
before_script:
- rm -f *.db
variables:
POSTGRES_DB: lutim_db
POSTGRES_USER: lutim
POSTGRES_PASSWORD: lutim_pwd
### Jobs templates
##
#
.retry: &retry
retry: 2
except:
- tags
.carton_bdd_template: &carton_bdd_definition
<<: *retry
stage: carton_bdd
artifacts:
paths:
- local/
needs:
- carton
.test_template: &test_definition
<<: *retry
stage: tests
script:
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make test
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make watch
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make cleanbdd
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make cleanfiles
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make stats
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make test-junit-output
artifacts:
paths:
- tap.xml
- cover_db/
.sqlite_template: &sqlite_definition
<<: *test_definition
needs:
- carton_sqlite
.pg_template: &pg_definition
<<: *test_definition
needs:
- carton_postgresql
services:
- name: postgres:9.6
alias: postgres
### Publish tag changelog and create a toot
##
#
include:
- 'https://framagit.org/fiat-tux/gitlabci-snippets/raw/4e4e03322e95e9b0124c714456ebf1bdc02ad43f/publish_changelog.gitlab-ci.yml'
- 'https://framagit.org/fiat-tux/gitlabci-snippets/raw/4e4e03322e95e9b0124c714456ebf1bdc02ad43f/pouet-it-from-ci.gitlab-ci.yml'
### Podcheck
##
#
podcheck:
<<: *retry
stage: podcheck
script:
- make podcheck
### Install common dependencies
##
#
carton:
<<: *retry
stage: carton
artifacts:
paths:
- local/
dependencies: []
script:
- carton install --deployment --without=sqlite --without=postgresql --without=minion --without=cache --without=memcached
when: always
### Install DB related dependencies
##
#
carton_sqlite:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=postgresql --without=minion --without=cache --without=memcached
carton_postgresql:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=sqlite --without=minion --without=cache --without=memcached
### SQLite tests
##
#
sqlite1:
<<: *sqlite_definition
before_script:
- carton install --deployment --without=postgresql --without=minion --without=cache --without=memcached
sqlite2:
<<: *sqlite_definition
before_script:
- carton install --deployment --without=postgresql --without=cache --without=memcached
sqlite3:
<<: *sqlite_definition
services:
- name: postgres:9.6
alias: postgres
before_script:
- carton install --deployment --without=cache --without=memcached
- export PGPASSWORD=lutim_pwd; echo 'CREATE DATABASE lutim_minion WITH OWNER lutim;' | psql -h postgres -U lutim lutim_db
### PostgreSQL tests
##
#
postgresql1:
<<: *pg_definition
before_script:
- carton install --deployment --without=sqlite --without=minion --without=cache --without=memcached
postgresql2:
<<: *pg_definition
before_script:
- carton install --deployment --without=cache --without=memcached
postgresql3:
<<: *pg_definition
before_script:
- carton install --deployment --without=sqlite --without=cache --without=memcached
- export PGPASSWORD=lutim_pwd; echo 'CREATE DATABASE lutim_minion WITH OWNER lutim;' | psql -h postgres -U lutim lutim_db
### Code coverage
##
#
cover:
stage: cover
script:
- make cover
coverage: '/Total.* (\d+\.\d+)$/'
artifacts:
reports:
junit: tap.xml
except:
- tags