.gitlab-ci.yml 2.05 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
unit-testing:
  stage: test
  services:
lain's avatar
lain committed
48
  - name: lainsoykaf/postgres-with-rum
49
    alias: postgres
50
51
    command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
  script:
52
    - mix deps.get
53
54
    - mix ecto.create
    - mix ecto.migrate
55
    - mix test --trace --preload-modules
feld's avatar
feld committed
56
    - mix coveralls
57

lain's avatar
lain committed
58
unit-testing-rum:
59
  stage: test
lain's avatar
lain committed
60
61
  services:
  - name: lainsoykaf/postgres-with-rum
62
    alias: postgres
lain's avatar
lain committed
63
    command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
64
65
  variables:
    RUM_ENABLED: "true"
lain's avatar
lain committed
66
67
68
69
70
71
72
  script:
    - mix deps.get
    - mix ecto.create
    - mix ecto.migrate
    - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
    - mix test --trace --preload-modules

73
74
75
76
77
78
79
80
lint:
  stage: test
  script:
    - mix format --check-formatted

analysis:
  stage: test
  script:
rinpatch's avatar
rinpatch committed
81
    - mix deps.get
82
83
    - mix credo --strict --only=warnings,todo,fixme,consistency,readability

84
docs-deploy:
85
  stage: deploy
rinpatch's avatar
rinpatch committed
86
87
88
89
90
91
92
93
94
95
96
  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 -
97
    - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"