Newer
Older
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2021 Indiscale GmbH <info@indiscale.com>
# Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com>
# Copyright (C) 2021 Timm Fitschen <d.hornung@indiscale.com>
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
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
variables:
OCTAVE_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE/testenv:$CI_COMMIT_REF_NAME
image: $OCTAVE_REGISTRY_IMAGE
stages:
- setup
- test
- deploy
######## Setup ########
# Build a docker image in which tests for this repository can run
build-testenv:
tags: [ cached-dind ]
stage: setup
image: docker:20.10
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull "$OCTAVE_REGISTRY_IMAGE" || true
- docker build
--pull
--cache-from "$OCTAVE_REGISTRY_IMAGE"
- docker push "$OCTAVE_REGISTRY_IMAGE"
# Formatting with miss_hit
code_style:
tags: [ docker ]
stage: test
script:
allow_failure: true
# Unit tests
test:
tags: [ docker ]
stage: test
script:
linting:
tags: [ docker ]
stage: test
script:
- mh_lint --octave ./
# Build the sphinx documentation and make it ready for deployment by Gitlab Pages
# Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages
.pages_prepare: &pages_prepare
tags: [ cached-dind ]
stage: deploy
script:
- make doc
- cp -r build/doc/html ./public
test_pages:
<<: *pages_prepare
except:
refs:
- main
artifacts:
paths:
- public
pages:
<<: *pages_prepare
only:
refs:
- main
artifacts:
paths:
- public