mobilizon.chapril.org-mobil.../.gitlab-ci.yml
Thomas Citharel a736965e91
Add basic styleguide
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-10-07 10:25:21 +02:00

112 lines
2.1 KiB
YAML

image: tcitworld/mobilizon-ci
stages:
- check
- test
- deploy
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"
lint:
stage: check
script:
- mix deps.get
- mix credo list
- mix format --check-formatted --dry-run
- cd js
- yarn install
- yarn run lint
cache:
paths:
- deps
- js/node_modules
deps:
stage: check
script:
- mix deps.get
- mix hex.outdated
- cd js
- yarn outdated
allow_failure: true
cache:
paths:
- deps
- js/node_modules
exunit:
stage: test
services:
- name: mdillon/postgis:11
alias: postgres
dependencies:
- js
before_script:
- mix deps.get
- MIX_ENV=test mix ecto.create
- MIX_ENV=test mix ecto.migrate
script:
- mix coveralls
cache:
paths:
- deps
- _build
cypress:
stage: test
services:
- name: mdillon/postgis:11
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
pages:
stage: deploy
script:
- mkdir public
- mix deps.get
- mix docs
- mv doc public/backend
- cd js
- yarn install
- yarn run styleguide:build
- mv styleguide ../public/frontend
cache:
paths:
- deps
- js/node_modules
only:
- master
artifacts:
expire_in: 1 hour
paths:
- public