Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.1KB

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