forked from Ensembl/ensembl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
111 lines (99 loc) · 3.75 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#
# Test-job template
#
.ensembl_test_template:
image: dockerhub.ebi.ac.uk/ensembl-infrastructure/ensembl-ci-docker-images:${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 default-libmysqlclient-dev default-mysql-client
- apt-get install -y libssl-dev sqlite3
- git clone --branch=main --depth=1 https://github.com/Ensembl/ensembl-test.git
- git clone --branch=main --depth=1 https://github.com/Ensembl/ensembl-io.git
- git clone --branch=main --depth=1 https://github.com/Ensembl/ensembl-variation.git
- git clone --branch=main --depth=1 https://github.com/Ensembl/ensembl-compara.git
- git clone --branch=release-1-6-924 --depth=1 https://github.com/bioperl/bioperl-live.git
- cpanm -v --installdeps --notest . --with-all-features
- ( cd ensembl-test && cpanm -v --installdeps --notest . )
# - ( cd ensembl-io && cpanm -v --installdeps --notest . )
# - ( cd ensembl-variation && cpanm -v --installdeps --notest . )
- ( cd ensembl-compara && 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
- cp travisci/testdb.conf.gitlabci.mysql testdb.conf.mysql
- cp travisci/testdb.conf.travisci.SQLite testdb.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: test
only:
- master
- /^release/\d+$/
# Actual trigger jobs
# ensembl-rest; disabled for now because that repo a) hasn't got
# GitLab-CI config yet, and b) is still on the list in
# trigger-dependent-build.sh.
.test:trigger_rest:
extends: .dependent_template
trigger:
project: ensembl-gh-mirror/ensembl-rest
# Use the same branch as in this project
branch: ${CI_COMMIT_REF_NAME}
# Dependent builds on Travis
# Relies on the secret variable TRAVIS_AUTH_TOKEN to actually work,
# moreover the account associated with the token must have write
# access to *all* dependent repositories; to be exact what it needs
# is the Travis 'create_request' permission but Travis permissions are
# generated from GitHub ones and it seems that in order to have
# 'create_request' on the latter one requires 'write' on the former.
test:trigger_travis:
extends: .dependent_template
image: alpine:3.10
variables:
AUTH_TOKEN: ${TRAVIS_AUTH_TOKEN}
TRAVIS_REPO_SLUG: ${CI_PROJECT_PATH}
TRAVIS_BRANCH: ${CI_COMMIT_REF_NAME}
TRAVIS_COMMIT: ${CI_COMMIT_SHA}
# Safe as long as run conditions above do not include merge requests
TRAVIS_PULL_REQUEST: "false"
script:
- apk add --no-cache bash curl python3
- ${CI_PROJECT_DIR}/travisci/trigger-dependent-build.sh