Add basic styleguide

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-05 21:17:18 +02:00
parent a6c38e1e60
commit a736965e91
22 changed files with 2321 additions and 358 deletions

View File

@@ -1,10 +1,8 @@
image: tcitworld/mobilizon-ci
stages:
- deps
- front
- back
- e2e
- check
- test
- deploy
variables:
@@ -22,117 +20,37 @@ variables:
GEOLITE_CITIES_PATH: "/usr/share/GeoIP/GeoLite2-City.mmdb"
MOBILIZON_INSTANCE_REGISTRATIONS_OPEN: "true"
setup_elixir_deps:
stage: deps
lint:
stage: check
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
- cd js
- yarn install
- yarn run lint
cache:
paths:
- deps
- js/node_modules
elixir_deps:
stage: back
before_script:
- mix deps.get
deps:
stage: check
script:
- mix deps.get
- mix hex.outdated
- cd js
- yarn outdated
allow_failure: true
cache:
paths:
- deps
- js/node_modules
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
mix:
stage: back
exunit:
stage: test
services:
- name: mdillon/postgis:10
- name: mdillon/postgis:11
alias: postgres
dependencies:
- js
@@ -147,10 +65,10 @@ mix:
- deps
- _build
e2e:
stage: e2e
cypress:
stage: test
services:
- name: mdillon/postgis:10
- name: mdillon/postgis:11
alias: postgres
script:
- mix deps.get
@@ -168,4 +86,27 @@ e2e:
expire_in: 2 day
paths:
- js/tests/e2e/screenshots/**/*.png
- js/tests/e2e/videos/**/*.mp4
- 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