.gitlab-ci.yml 1.58 KB
Newer Older
rinpatch's avatar
rinpatch committed
1
image: elixir:1.8.1
lain's avatar
lain committed
2
3
4

variables:
  POSTGRES_DB: pleroma_test
Roger Braun's avatar
Roger Braun committed
5
6
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: postgres
lain's avatar
lain committed
7
  DB_HOST: postgres
8
  MIX_ENV: test
9

rinpatch's avatar
rinpatch committed
10
cache:
11
  key: ${CI_COMMIT_REF_SLUG}
rinpatch's avatar
rinpatch committed
12
13
  paths:
          - deps
Rin Toshaka's avatar
Rin Toshaka committed
14
          - _build
lain's avatar
lain committed
15
stages:
16
  - build
lain's avatar
lain committed
17
  - test
18
  - deploy
lain's avatar
lain committed
19
20

before_script:
lain's avatar
lain committed
21
22
  - mix local.hex --force
  - mix local.rebar --force
lain's avatar
lain committed
23

24
25
build:
  stage: build
lain's avatar
lain committed
26
  script:
rinpatch's avatar
huh    
rinpatch committed
27
  - mix deps.get
28
  - mix compile --force
rinpatch's avatar
rinpatch committed
29

30
docs-build:
31
  stage: build
rinpatch's avatar
rinpatch committed
32
33
34
35
36
  only:
  - master@pleroma/pleroma
  - develop@pleroma/pleroma
  variables:
    MIX_ENV: dev
37
  script:
rinpatch's avatar
rinpatch committed
38
39
40
41
42
43
44
    - mix deps.get
    - mix compile
    - mix docs
  artifacts:
    paths:
      - priv/static/doc

45
46
47
48
49
50
unit-testing:
  stage: test
  services:
  - name: postgres:9.6.2
    command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
  script:
51
    - mix deps.get
52
53
    - mix ecto.create
    - mix ecto.migrate
54
    - mix test --trace --preload-modules
feld's avatar
feld committed
55
    - mix coveralls
56
57
58
59
60
61
62
63
64

lint:
  stage: test
  script:
    - mix format --check-formatted

analysis:
  stage: test
  script:
rinpatch's avatar
rinpatch committed
65
    - mix deps.get
66
67
68
    - mix credo --strict --only=warnings,todo,fixme,consistency,readability


69
docs-deploy:
70
  stage: deploy
rinpatch's avatar
rinpatch committed
71
72
73
74
75
76
77
78
79
80
81
  image: alpine:3.9
  only:
  - master@pleroma/pleroma
  - develop@pleroma/pleroma
  before_script:
    - apk update && apk add openssh-client rsync
  script:
    - mkdir -p ~/.ssh
    - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
82
    - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"