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.

98 lines
2.0KB

  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. - deploy
  17. before_script:
  18. - mix local.hex --force
  19. - mix local.rebar --force
  20. build:
  21. stage: build
  22. script:
  23. - mix deps.get
  24. - mix compile --force
  25. docs-build:
  26. stage: build
  27. only:
  28. - master@pleroma/pleroma
  29. - develop@pleroma/pleroma
  30. variables:
  31. MIX_ENV: dev
  32. script:
  33. - mix deps.get
  34. - mix compile
  35. - mix docs
  36. artifacts:
  37. paths:
  38. - priv/static/doc
  39. unit-testing:
  40. stage: test
  41. services:
  42. - name: lainsoykaf/postgres-with-rum
  43. alias: postgres
  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
  53. services:
  54. - name: lainsoykaf/postgres-with-rum
  55. alias: postgres
  56. command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
  57. variables:
  58. RUM_ENABLED: "true"
  59. script:
  60. - mix deps.get
  61. - mix ecto.create
  62. - mix ecto.migrate
  63. - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
  64. - mix test --trace --preload-modules
  65. lint:
  66. stage: test
  67. script:
  68. - mix format --check-formatted
  69. analysis:
  70. stage: test
  71. script:
  72. - mix deps.get
  73. - mix credo --strict --only=warnings,todo,fixme,consistency,readability
  74. docs-deploy:
  75. stage: deploy
  76. image: alpine:3.9
  77. only:
  78. - master@pleroma/pleroma
  79. - develop@pleroma/pleroma
  80. before_script:
  81. - apk update && apk add openssh-client rsync
  82. script:
  83. - mkdir -p ~/.ssh
  84. - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
  85. - eval $(ssh-agent -s)
  86. - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
  87. - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"