Files
lutim/.gitlab-ci.yml
2023-12-29 08:31:46 +01:00

155 lines
3.5 KiB
YAML

image: hatsoftwares/lutim-test-ci:latest
stages:
- create_release
- 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/2aac6c1f3dd725d9aed57549da67a92759f9f9ec/create-release-from-ci.gitlab-ci.yml'
- 'https://framagit.org/fiat-tux/gitlabci-snippets/-/raw/41345a919d3c927991782f5fd17e0c7b338a3f3a/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:
- cpanm -l local Devel::Cover~1.29
- 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