feat(ci): use slim image with parallel steps
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
Also, install git and make in every step.
This commit is contained in:
parent
71f36bca5e
commit
1a1eaa7ef7
60
.drone.yml
60
.drone.yml
@ -36,64 +36,82 @@ steps:
|
|||||||
region: us-east-1
|
region: us-east-1
|
||||||
restore: true
|
restore: true
|
||||||
|
|
||||||
- name: get dependencies
|
|
||||||
image: &elixir 'hexpm/elixir:1.17.2-erlang-27.0-debian-bookworm-20240701-slim'
|
|
||||||
commands:
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y git
|
|
||||||
- mix do local.rebar --force, local.hex --force
|
|
||||||
- mix do deps.get, deps.compile
|
|
||||||
- mix compile --force
|
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: *elixir
|
image: &elixir 'hexpm/elixir:1.17.2-erlang-27.0-debian-bookworm-20240701-slim'
|
||||||
environment:
|
environment:
|
||||||
MIX_ENV: test
|
MIX_ENV: test
|
||||||
POSTGRES_HOST: &db_host db
|
POSTGRES_HOST: &db_host db
|
||||||
POSTGRES_USER: &db_user postgres
|
POSTGRES_USER: &db_user postgres
|
||||||
POSTGRES_PASS: &db_pass postgres
|
POSTGRES_PASS: &db_pass postgres
|
||||||
commands:
|
commands:
|
||||||
- mix do local.rebar --force, local.hex --force
|
- apt-get update
|
||||||
|
- apt-get install -y git make
|
||||||
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
- mix test --cover --trace --slowest 10
|
- mix test --cover --trace --slowest 10
|
||||||
|
depends_on:
|
||||||
|
- 'database healthecheck'
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: compile app
|
- name: compile app
|
||||||
image: *elixir
|
image: *elixir
|
||||||
commands:
|
commands:
|
||||||
- mix do local.rebar --force, local.hex --force
|
- apt-get update
|
||||||
|
- apt-get install -y git make
|
||||||
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
- mix compile --force --all-warnings --warnings-as-errors
|
- mix compile --force --all-warnings --warnings-as-errors
|
||||||
|
depends_on:
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: audit deps
|
- name: audit deps
|
||||||
image: *elixir
|
image: *elixir
|
||||||
commands:
|
commands:
|
||||||
- mix do local.rebar --force, local.hex --force
|
- apt-get update
|
||||||
|
- apt-get install -y git make
|
||||||
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
- mix hex.audit
|
- mix hex.audit
|
||||||
- mix deps.audit
|
- mix deps.audit
|
||||||
- mix deps.unlock --check-unused
|
- mix deps.unlock --check-unused
|
||||||
# - mix hex.outdated
|
# - mix hex.outdated
|
||||||
|
depends_on:
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: format check
|
- name: format check
|
||||||
image: *elixir
|
image: *elixir
|
||||||
commands:
|
commands:
|
||||||
- mix do local.rebar --force, local.hex --force
|
- apt-get update
|
||||||
|
- apt-get install -y git make
|
||||||
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
- mix format --dry-run --check-formatted
|
- mix format --dry-run --check-formatted
|
||||||
|
depends_on:
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: credo check
|
- name: credo check
|
||||||
image: *elixir
|
image: *elixir
|
||||||
commands:
|
commands:
|
||||||
- mix do local.rebar --force, local.hex --force
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
- mix credo suggest --strict --format=flycheck
|
- mix credo suggest --strict --format=flycheck
|
||||||
|
depends_on:
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: dialyzer check
|
- name: dialyzer check
|
||||||
image: *elixir
|
image: *elixir
|
||||||
commands:
|
commands:
|
||||||
- mix do local.rebar --force, local.hex --force
|
- apt-get update
|
||||||
|
- apt-get install -y git make
|
||||||
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
- mix dialyzer --no-check --quiet --ignore-exit-status --format short
|
- mix dialyzer --no-check --quiet --ignore-exit-status --format short
|
||||||
|
depends_on:
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: sobelow check
|
- name: sobelow check
|
||||||
image: *elixir
|
image: *elixir
|
||||||
commands:
|
commands:
|
||||||
- mix do local.rebar --force, local.hex --force
|
- apt-get update
|
||||||
|
- apt-get install -y git make
|
||||||
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
- mix sobelow
|
- mix sobelow
|
||||||
|
depends_on:
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: rebuild cache
|
- name: rebuild cache
|
||||||
image: *drone_cache
|
image: *drone_cache
|
||||||
@ -114,6 +132,14 @@ steps:
|
|||||||
path_style: true
|
path_style: true
|
||||||
rebuild: true
|
rebuild: true
|
||||||
region: us-east-1
|
region: us-east-1
|
||||||
|
depends_on:
|
||||||
|
- 'test'
|
||||||
|
- 'compile app'
|
||||||
|
- 'audit deps'
|
||||||
|
- 'format check'
|
||||||
|
- 'credo check'
|
||||||
|
- 'dialyzer check'
|
||||||
|
- 'sobelow check'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- name: *db_host
|
- name: *db_host
|
||||||
|
Loading…
x
Reference in New Issue
Block a user