This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
augie/.gitlab-ci.yml

106 lines
1.9 KiB
YAML
Raw Normal View History

2019-12-03 10:46:51 +13:00
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:
2020-03-08 15:05:20 +13:00
- webapp/deps
- webapp/_build
2019-12-03 10:46:51 +13:00
- .mix
- /root/.cache
artifacts:
paths:
2020-03-08 15:05:20 +13:00
- webapp/deps/
- webapp/_build/
- webapp/.rebar3/
2019-12-03 10:46:51 +13:00
- .mix
expire_in: 60 mins
before_script:
- mix local.hex --force
- mix local.rebar --force
2020-03-08 15:05:20 +13:00
- cd webapp
2019-12-03 10:46:51 +13:00
script:
- mix deps.get
- mix compile
javascript dependencies:
image: node:latest
stage: javascript dependencies
dependencies:
- elixir dependencies
cache:
key: "$CI_JOB_NAME"
paths:
2020-03-08 15:05:20 +13:00
- webapp/assets/node_modules
2019-12-03 10:46:51 +13:00
- /root/.yarn-cache
artifacts:
paths:
2020-03-08 15:05:20 +13:00
- webapp/assets/node_modules
2019-12-03 10:46:51 +13:00
expire_in: 60 mins
before_script:
2020-03-08 15:05:20 +13:00
- cd webapp
2019-12-03 10:46:51 +13:00
script:
- yarn --cwd ./assets install --non-interactive
mix hex.audit:
image: elixir:latest
dependencies:
- elixir dependencies
stage: lint
before_script:
2020-03-08 15:05:20 +13:00
- cd webapp
2019-12-03 10:46:51 +13:00
script:
- mix hex.audit
mix credo:
image: elixir:latest
dependencies:
- elixir dependencies
stage: lint
before_script:
2020-03-08 15:05:20 +13:00
- cd webapp
2019-12-03 10:46:51 +13:00
script:
- mix credo --strict
mix format --check-formatted:
image: elixir:latest
dependencies:
- elixir dependencies
stage: lint
before_script:
2020-03-08 15:05:20 +13:00
- cd webapp
2019-12-03 10:46:51 +13:00
script:
- mix format --check-formatted
mix test:
image: elixir:latest
stage: test
dependencies:
- elixir dependencies
- javascript dependencies
before_script:
2020-03-08 15:05:20 +13:00
- cd webapp
2019-12-03 10:46:51 +13:00
script:
- mix test
release:
image: registry.gitlab.com/jimsy/balena-cli-docker
stage: release
only:
- master
before_script:
- balena login --token $BALENA_API_KEY
script:
- balena push $BALENA_APP