stages:
- elixir dependencies
- lint
- javascript dependencies
- test
- release
variables:
MIX_HOME: $CI_PROJECT_DIR/.mix
MIX_ENV: test
elixir dependencies:
image: elixir:latest
stage: elixir dependencies
cache:
key: "$CI_JOB_NAME"
paths:
- webapp/deps
- webapp/_build
- .mix
- /root/.cache
artifacts:
- webapp/deps/
- webapp/_build/
- webapp/.rebar3/
expire_in: 60 mins
before_script:
- mix local.hex --force
- mix local.rebar --force
- cd webapp
script:
- mix deps.get
- mix compile
javascript dependencies:
image: node:latest
stage: javascript dependencies
dependencies:
- webapp/assets/node_modules
- /root/.yarn-cache
- yarn --cwd ./assets install --non-interactive
mix hex.audit:
stage: lint
- mix hex.audit
mix credo:
- mix credo --strict
mix format --check-formatted:
- mix format --check-formatted
mix test:
stage: test
- mix test
release:
image: registry.gitlab.com/jimsy/balena-cli-docker
stage: release
only:
- master
- balena login --token $BALENA_API_KEY
- balena push $BALENA_APP