CI: Add rum variant testing.
[akkoma] / .gitlab-ci.yml
1 image: elixir:1.8.1
2
3 variables:
4 POSTGRES_DB: pleroma_test
5 POSTGRES_USER: postgres
6 POSTGRES_PASSWORD: postgres
7 DB_HOST: postgres
8 MIX_ENV: test
9
10 cache:
11 key: ${CI_COMMIT_REF_SLUG}
12 paths:
13 - deps
14 - _build
15 stages:
16 - build
17 - test
18 - test-rum
19 - deploy
20
21 before_script:
22 - mix local.hex --force
23 - mix local.rebar --force
24
25 build:
26 stage: build
27 script:
28 - mix deps.get
29 - mix compile --force
30
31 docs-build:
32 stage: build
33 only:
34 - master@pleroma/pleroma
35 - develop@pleroma/pleroma
36 variables:
37 MIX_ENV: dev
38 script:
39 - mix deps.get
40 - mix compile
41 - mix docs
42 artifacts:
43 paths:
44 - priv/static/doc
45
46 unit-testing:
47 stage: test
48 services:
49 - name: lainsoykaf/postgres-with-rum
50 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
51 script:
52 - mix deps.get
53 - mix ecto.create
54 - mix ecto.migrate
55 - mix test --trace --preload-modules
56 - mix coveralls
57
58 unit-testing-rum:
59 stage: test-rum
60 services:
61 - name: lainsoykaf/postgres-with-rum
62 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
63 script:
64 - "echo 'config :pleroma, :database, rum_enabled: true' >> config/test.exs"
65 - mix deps.get
66 - mix ecto.create
67 - mix ecto.migrate
68 - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
69 - mix test --trace --preload-modules
70 - mix coveralls
71
72 lint:
73 stage: test
74 script:
75 - mix format --check-formatted
76
77 analysis:
78 stage: test
79 script:
80 - mix deps.get
81 - mix credo --strict --only=warnings,todo,fixme,consistency,readability
82
83 docs-deploy:
84 stage: deploy
85 image: alpine:3.9
86 only:
87 - master@pleroma/pleroma
88 - develop@pleroma/pleroma
89 before_script:
90 - apk update && apk add openssh-client rsync
91 script:
92 - mkdir -p ~/.ssh
93 - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
94 - eval $(ssh-agent -s)
95 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
96 - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"