feat(ci): run test and lint in parallel
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
This commit is contained in:
parent
0cc3d2f4a5
commit
217cae6f39
156
.drone.yml
156
.drone.yml
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: test
|
name: test and lint
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
@ -36,17 +36,71 @@ 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'
|
||||||
|
commands:
|
||||||
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
|
depends_on:
|
||||||
|
- 'restore cache'
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: 'hexpm/elixir:1.17.2-erlang-27.0-debian-bookworm-20240701'
|
image: *elixir
|
||||||
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, deps.get, deps.compile
|
|
||||||
- mix compile
|
- mix compile
|
||||||
- mix test --cover --trace --slowest 10
|
- mix test --cover --trace --slowest 10
|
||||||
|
depends_on:
|
||||||
|
- 'database healthcheck'
|
||||||
|
- 'get dependencies'
|
||||||
|
|
||||||
|
- name: compile app
|
||||||
|
image: &elixir 'hexpm/elixir:1.17.2-erlang-27.0-debian-bookworm-20240701'
|
||||||
|
commands:
|
||||||
|
- mix compile --all-warnings --warnings-as-errors
|
||||||
|
depends_on:
|
||||||
|
- 'get dependencies'
|
||||||
|
|
||||||
|
- name: audit deps
|
||||||
|
image: *elixir
|
||||||
|
commands:
|
||||||
|
- mix hex.audit
|
||||||
|
- mix deps.audit
|
||||||
|
- mix deps.unlock --check-unused
|
||||||
|
# - mix hex.outdated
|
||||||
|
depends_on:
|
||||||
|
- 'get dependencies'
|
||||||
|
|
||||||
|
- name: format check
|
||||||
|
image: *elixir
|
||||||
|
commands:
|
||||||
|
- mix format --dry-run --check-formatted
|
||||||
|
depends_on:
|
||||||
|
- 'get dependencies'
|
||||||
|
|
||||||
|
- name: credo check
|
||||||
|
image: *elixir
|
||||||
|
commands:
|
||||||
|
- mix credo suggest --strict --format=flycheck
|
||||||
|
depends_on:
|
||||||
|
- 'get dependencies'
|
||||||
|
|
||||||
|
- name: dialyzer check
|
||||||
|
image: *elixir
|
||||||
|
commands:
|
||||||
|
- mix dialyzer --no-check --quiet --ignore-exit-status --format short
|
||||||
|
depends_on:
|
||||||
|
- 'get dependencies'
|
||||||
|
|
||||||
|
- name: sobelow check
|
||||||
|
image: *elixir
|
||||||
|
commands:
|
||||||
|
- mix sobelow
|
||||||
|
depends_on:
|
||||||
|
- 'get dependencies'
|
||||||
|
|
||||||
- name: rebuild cache
|
- name: rebuild cache
|
||||||
image: *drone_cache
|
image: *drone_cache
|
||||||
@ -67,6 +121,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
|
||||||
@ -74,91 +136,3 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: *db_user
|
POSTGRES_USER: *db_user
|
||||||
POSTGRES_PASSWORD: *db_pass
|
POSTGRES_PASSWORD: *db_pass
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: lint
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: restore cache
|
|
||||||
image: &drone_cache 'meltwater/drone-cache:v1.4.0'
|
|
||||||
environment:
|
|
||||||
AWS_ACCESS_KEY_ID:
|
|
||||||
from_secret: minio_user
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
from_secret: minio_password
|
|
||||||
settings:
|
|
||||||
archive_format: gzip
|
|
||||||
bucket: trainlog-cache
|
|
||||||
cache_key: '{{ .Repo.Name }}-{{ checksum ".tool-versions" }}-{{ checksum "mix.lock" }}'
|
|
||||||
endpoint: minio:9000
|
|
||||||
mount:
|
|
||||||
- _build
|
|
||||||
- deps
|
|
||||||
path_style: true
|
|
||||||
region: us-east-1
|
|
||||||
restore: true
|
|
||||||
|
|
||||||
- name: compile app
|
|
||||||
image: &elixir 'hexpm/elixir:1.17.2-erlang-27.0-debian-bookworm-20240701'
|
|
||||||
commands:
|
|
||||||
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
|
||||||
- mix compile --all-warnings --warnings-as-errors
|
|
||||||
|
|
||||||
- name: audit deps
|
|
||||||
image: *elixir
|
|
||||||
commands:
|
|
||||||
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
|
||||||
- mix hex.audit
|
|
||||||
- mix deps.audit
|
|
||||||
- mix deps.unlock --check-unused
|
|
||||||
# - mix hex.outdated
|
|
||||||
|
|
||||||
- name: format check
|
|
||||||
image: *elixir
|
|
||||||
commands:
|
|
||||||
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
|
||||||
- mix format --dry-run --check-formatted
|
|
||||||
|
|
||||||
- name: credo check
|
|
||||||
image: *elixir
|
|
||||||
commands:
|
|
||||||
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
|
||||||
- mix credo suggest --strict --format=flycheck
|
|
||||||
|
|
||||||
- name: dialyzer check
|
|
||||||
image: *elixir
|
|
||||||
commands:
|
|
||||||
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
|
||||||
- mix dialyzer --no-check --quiet --ignore-exit-status --format short
|
|
||||||
|
|
||||||
- name: sobelow check
|
|
||||||
image: *elixir
|
|
||||||
commands:
|
|
||||||
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
|
||||||
- mix sobelow
|
|
||||||
|
|
||||||
- name: rebuild cache
|
|
||||||
image: *drone_cache
|
|
||||||
environment:
|
|
||||||
AWS_ACCESS_KEY_ID:
|
|
||||||
from_secret: minio_user
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
from_secret: minio_password
|
|
||||||
settings:
|
|
||||||
archive_format: gzip
|
|
||||||
bucket: trainlog-cache
|
|
||||||
cache_key: '{{ .Repo.Name }}-{{ checksum ".tool-versions" }}-{{ checksum "mix.lock" }}'
|
|
||||||
endpoint: minio:9000
|
|
||||||
exit_code: true
|
|
||||||
mount:
|
|
||||||
- _build
|
|
||||||
- deps
|
|
||||||
path_style: true
|
|
||||||
rebuild: true
|
|
||||||
region: us-east-1
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user