Commit e62eb711 authored by Marek Szuba's avatar Marek Szuba

Add prototype Gitlab-CI configuration

What I have done here is take .gitlab-ci.yml and
MultiTestDB.conf.gitlabci.mysql from ensembl (my own development version
in case of the former), modify the before_script section of the former
to account for differences in dependencies between the two projects,
create a dependent-build trigger attempting to launch one on
ensembl-gh-mirror/ensembl (i.e.  already on EBI Gitlab), and fix the
declaration of same because it has turned out variable expansion
in trigger declarations works only in the branch field, not in "project".

Note that all of this results in a somewhat different build
matrix than on Travis but unlike there, on GitLab we have got
consistency between ensembl and ensembl-test.
parent 47ae605f
stages:
- test
- posttest
#
# Test-job template
#
.ensembl_test_template:
image: perl:${PERL_VERSION}
services:
- mysql:5.6
variables:
# FIXME: set some password for both users
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_USER: "travis"
MYSQL_PASSWORD: ""
USER: "gitlabci"
before_script:
- apt-get update
- apt-get install -y build-essential cpanminus git
- apt-get install -y libmysqlclient-dev mysql-client || apt-get install -y default-libmysqlclient-dev default-mysql-client
- apt-get install -y libssl-dev sqlite3
- git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl.git
- git clone --branch=release-1-6-924 --depth=1 https://github.com/bioperl/bioperl-live.git
# Install IO::Scalar before processing the cpanfile because one of the dependencies
# of Test::FTP::Server requires it yet does not declare it as a dependency, and
# cpanm - or to be precise the module CPAN::Meta::Prereqs - scrambles the order
# of entries in cpanfiles (see https://github.com/miyagawa/cpanfile/issues/42).
# Cpanfile upstream categorically refuses to implement the forcing of dependencies
# (see https://github.com/miyagawa/cpanfile/issues/3) so we will have to keep this
# here until either Net::FTPServer has been fixed or we stop using Test::FTP::Server
- cpanm -n IO::Scalar
- cpanm -v --installdeps --notest .
- ( cd ensembl && cpanm -v --installdeps --notest . )
- cpanm -n Devel::Cover::Report::Coveralls
- cpanm -n DBD::SQLite
- cp travisci/MultiTestDB.conf.gitlabci.mysql modules/t/MultiTestDB.conf.mysql
- cp travisci/MultiTestDB.conf.travisci.SQLite modules/t/MultiTestDB.conf.SQLite
- mysql -u root -h mysql -e 'GRANT ALL PRIVILEGES ON *.* TO "travis"@"%"'
#
# Test jobs
#
test:perl5.14-sqlite:
stage: test
extends: .ensembl_test_template
variables:
PERL_VERSION: "5.14"
COVERALLS: "false"
DB: "sqlite"
script:
- ./travisci/harness.sh
test:perl5.30-mysql:
stage: test
extends: .ensembl_test_template
variables:
PERL_VERSION: "5.30"
# Note: relies on the secret variable COVERALLS_REPO_TOKEN for report uploads to work
COVERALLS: "true"
DB: "mysql"
script:
- ./travisci/harness.sh
#
# Triggers for dependent builds
#
# The template. It doesn't presently support PRs before they are
# merged (would need extended run condition and better selection of
# downstream branches) - but then again, we do not trigger dependent
# builds for PRs on Travis either.
.dependent_template:
stage: posttest
# We want this to run even if any test jobs fail
when: always
only:
- master
- /^release/\d+$/
trigger:
# Use the same branch as in this project
branch: ${CI_COMMIT_REF_NAME}
# Actual trigger jobs
post:trigger_main:
extends: .dependent_template
trigger:
project: ensembl-gh-mirror/ensembl
{
'driver' => 'mysql',
'host' => 'mysql',
'port' => '3306',
'user' => 'travis',
}
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