-
Notifications
You must be signed in to change notification settings - Fork 27
/
.gitlab-ci.yml
47 lines (42 loc) · 1.37 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
default:
image: codemoon:latest
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
# don't run a push pipeline if a merge request pipeline if a merge request exists
when: never
- when: always
stages:
- lint
- test
rubocop:
stage: lint
rules:
- if: '$CI_MERGE_REQUEST_ID'
when: always
- when: never
script:
- source /home/codeocean/.rvm/scripts/rvm
- bundle install
- echo $CI_MERGE_REQUEST_DIFF_BASE_SHA
- DIFF=$(git diff --name-only --diff-filter=d $CI_MERGE_REQUEST_DIFF_BASE_SHA)
- echo $DIFF
- "if [[ ! -z $DIFF ]]; then bundle exec rubocop --force-exclusion --parallel --display-style-guide $DIFF; fi"
allow_failure: true
rspec:
stage: test
before_script:
- sudo -u postgres /usr/lib/postgresql/13/bin/postgres -D /etc/postgresql/13/main/ &
- sleep 3
- sudo wrapdocker
- for f in action_mailer.yml database.yml code_ocean.yml docker.yml.erb mnemosyne.yml; do if [ ! -f config/$f ]; then cp config/$f.ci config/$f; fi; done
- source /home/codeocean/.rvm/scripts/rvm
- bundle install
- yarn install
- export RAILS_ENV=test
- rake db:prepare
- docker login -u "${DOCKERHUB_USER}" -p "${DOCKERHUB_PASS}"
- docker pull openhpi/co_execenv_java:8-antlr
script:
- rspec --format progress
coverage: '/\(\d+.\d+\%\) covered/'