mobilizon/.gitlab-ci.yml

171 lines
2.8 KiB
YAML
Raw Normal View History

image: tcitworld/mobilizon-ci
2018-01-13 23:35:11 +01:00
stages:
- deps
- front
- back
- e2e
- deploy
2018-01-13 23:35:11 +01:00
variables:
MIX_ENV: "test"
# DB Variables for Postgres / Postgis
POSTGRES_DB: mobilizon_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_HOST: postgres
# DB Variables for Mobilizon
MOBILIZON_DATABASE_USERNAME: $POSTGRES_USER
MOBILIZON_DATABASE_PASSWORD: $POSTGRES_PASSWORD
MOBILIZON_DATABASE_DBNAME: $POSTGRES_DB
MOBILIZON_DATABASE_HOST: $POSTGRES_HOST
GEOLITE_CITIES_PATH: "/usr/share/GeoIP/GeoLite2-City.mmdb"
MOBILIZON_INSTANCE_REGISTRATIONS_OPEN: "true"
setup_elixir_deps:
stage: deps
script:
- mix deps.get
- mix compile
cache:
paths:
- deps
- _build
setup_js_deps:
stage: deps
before_script:
- cd js
script:
- yarn install
after_script:
- cd ../
cache:
paths:
- js/node_modules
js:
stage: front
before_script:
- cd js
- yarn install
script:
- yarn run build
after_script:
- cd ../
cache:
paths:
- js/node_modules
artifacts:
paths:
- priv/static
untracked: false
expire_in: 30 days
js_deps:
stage: front
before_script:
- cd js
- yarn install
script:
- yarn outdated
after_script:
- cd ../
cache:
paths:
- js/node_modules
allow_failure: true
js_check:
stage: front
before_script:
- cd js
- yarn install
script:
- yarn run lint
after_script:
- cd ../
cache:
paths:
- js/node_modules
elixir_check:
stage: back
before_script:
- mix deps.get
script:
- mix credo list
- mix format --check-formatted --dry-run
cache:
paths:
- deps
elixir_deps:
stage: back
before_script:
- mix deps.get
script:
- mix hex.outdated
allow_failure: true
cache:
paths:
- deps
2018-01-13 23:35:11 +01:00
pages:
stage: deploy
before_script:
- mix deps.get
script:
- mix docs
- mv doc public
cache:
paths:
- deps
only:
- master
artifacts:
expire_in: 1 hour
paths:
- public
2018-01-13 23:35:11 +01:00
mix:
stage: back
services:
- name: mdillon/postgis:10
alias: postgres
dependencies:
- js
before_script:
- mix deps.get
- MIX_ENV=test mix ecto.create
- MIX_ENV=test mix ecto.migrate
2018-01-13 23:35:11 +01:00
script:
- mix coveralls
cache:
paths:
- deps
- _build
e2e:
stage: e2e
services:
- name: mdillon/postgis:10
alias: postgres
script:
- mix deps.get
- cd js
- yarn install
- yarn run build
- cd ../
- MIX_ENV=e2e mix ecto.create
- MIX_ENV=e2e mix ecto.migrate
- MIX_ENV=e2e mix phx.server &
- cd js
- npx wait-on http://localhost:4000
- npx cypress run --record --parallel --key $CYPRESS_KEY
artifacts:
expire_in: 2 day
paths:
- js/tests/e2e/screenshots/**/*.png
- js/tests/e2e/videos/**/*.mp4