All checks were successful
continuous-integration/drone/push Build is passing
Upgrade runtimes: * [erlang from 26.2.5 to 27.0][0] * [elixir from 1.16.3 to 1.17.1][1] Upgrade dependencies: * `castore` [from 1.0.6 to 1.0.8](https://diff.hex.pm/diff/castore/1.0.6..1.0.8) * `cowboy` [from 2.10.0 to 2.12.0](https://diff.hex.pm/diff/cowboy/2.10.0..2.12.0) * `cowlib` [from 2.12.1 to 2.13.0](https://diff.hex.pm/diff/cowlib/2.12.1..2.13.0) * `credo` [from 1.7.6 to 1.7.7](https://diff.hex.pm/diff/credo/1.7.6..1.7.7) * `db_connection` [from 2.6.0 to 2.7.0](https://diff.hex.pm/diff/db_connection/2.6.0..2.7.0) * `ecto_sql` [from 3.11.2 to 3.11.3](https://diff.hex.pm/diff/ecto_sql/3.11.2..3.11.3) * `erlex` [from 0.2.6 to 0.2.7](https://diff.hex.pm/diff/erlex/0.2.6..0.2.7) * `hpax` [from 0.1.2 to 1.0.0](https://diff.hex.pm/diff/hpax/0.1.2..1.0.0) * `jason` [from 1.4.1 to 1.4.3](https://diff.hex.pm/diff/jason/1.4.1..1.4.3) * `mime` [from 2.0.5 to 2.0.6](https://diff.hex.pm/diff/mime/2.0.5..2.0.6) * `mint` [from 1.5.2 to 1.6.2](https://diff.hex.pm/diff/mint/1.5.2..1.6.2) * `nimble_options` [from 1.1.0 to 1.1.1](https://diff.hex.pm/diff/nimble_options/1.1.0..1.1.1) * `nimble_pool` [from 1.0.0 to 1.1.0](https://diff.hex.pm/diff/nimble_pool/1.0.0..1.1.0) * `phoenix` [from 1.7.12 to 1.7.14](https://diff.hex.pm/diff/phoenix/1.7.12..1.7.14) * `phoenix_ecto` [from 4.6.1 to 4.6.2](https://diff.hex.pm/diff/phoenix_ecto/4.6.1..4.6.2) * `phoenix_live_dashboard` [from 0.8.3 to 0.8.4](https://diff.hex.pm/diff/phoenix_live_dashboard/0.8.3..0.8.4) * `phoenix_live_view` [from 0.20.14 to 0.20.17](https://diff.hex.pm/diff/phoenix_live_view/0.20.14..0.20.17) * `phoenix_view` [from 2.0.3 to 2.0.4](https://diff.hex.pm/diff/phoenix_view/2.0.3..2.0.4) * `plug` [from 1.15.3 to 1.16.1](https://diff.hex.pm/diff/plug/1.15.3..1.16.1) * `plug_crypto` [from 2.0.0 to 2.1.0](https://diff.hex.pm/diff/plug_crypto/2.0.0..2.1.0) * `telemetry_metrics_prometheus_core` [from 1.2.0 to 1.2.1](https://diff.hex.pm/diff/telemetry_metrics_prometheus_core/1.2.0..1.2.1) * `websock_adapter` [from 0.5.5 to 0.5.6](https://diff.hex.pm/diff/websock_adapter/0.5.5..0.5.6) * `yaml_elixir` [from 2.9.0 to 2.11.0](https://diff.hex.pm/diff/yaml_elixir/2.9.0..2.11.0) To make `graphql` work with the newer `erlang` and `elixir`, the `absinthe` is installed directly from github: * [`absinthe`](358e273a26
) * [`absinthe_plug`](3a984cc341
) Finally, the `ci` routine was simplified, so test + lint is executed in parallel, and more core is reused. [0]: https://www.erlang.org/news/170 [1]: https://github.com/elixir-lang/elixir/releases/tag/v1.17.1 Reviewed-on: #83 Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com> Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
168 lines
4.1 KiB
YAML
168 lines
4.1 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: test and lint
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
|
|
steps:
|
|
- name: database healthcheck
|
|
image: &postgres 'postgres:16.3-alpine'
|
|
environment:
|
|
PGUSER: postgres
|
|
PGPASSWORD: postgres
|
|
PGHOST: db
|
|
commands:
|
|
- while ! pg_isready; do sleep 1; done
|
|
|
|
- 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
|
|
volumes: &volumes
|
|
- name: app_build
|
|
path: /drone/src/_build
|
|
- name: app_deps
|
|
path: /drone/src/deps
|
|
|
|
- name: dependencies and compile
|
|
image: &elixir 'hexpm/elixir:1.17.2-erlang-27.0-debian-bookworm-20240701-slim'
|
|
commands:
|
|
- 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
|
|
volumes: *volumes
|
|
|
|
- name: test
|
|
image: *elixir
|
|
environment:
|
|
MIX_ENV: test
|
|
POSTGRES_HOST: &db_host db
|
|
POSTGRES_USER: &db_user postgres
|
|
POSTGRES_PASS: &db_pass postgres
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y git make
|
|
- mix do local.rebar --force, local.hex --force
|
|
- mix test --cover --trace --slowest 10
|
|
volumes: *volumes
|
|
depends_on:
|
|
- 'database healthcheck'
|
|
- 'dependencies and compile'
|
|
|
|
- name: audit deps
|
|
image: *elixir
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y git make
|
|
- mix do local.rebar --force, local.hex --force
|
|
- mix hex.audit
|
|
- mix deps.audit
|
|
- mix deps.unlock --check-unused
|
|
# - mix hex.outdated
|
|
volumes: *volumes
|
|
depends_on:
|
|
- 'dependencies and compile'
|
|
|
|
- name: format check
|
|
image: *elixir
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y git make
|
|
- mix do local.rebar --force, local.hex --force
|
|
- mix format --dry-run --check-formatted
|
|
volumes: *volumes
|
|
depends_on:
|
|
- 'dependencies and compile'
|
|
|
|
- name: credo check
|
|
image: *elixir
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y git make
|
|
- mix do local.rebar --force, local.hex --force
|
|
- mix credo suggest --strict --format=flycheck
|
|
volumes: *volumes
|
|
depends_on:
|
|
- 'dependencies and compile'
|
|
|
|
- name: dialyzer check
|
|
image: *elixir
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y git make
|
|
- mix do local.rebar --force, local.hex --force
|
|
- mix dialyzer --no-check --quiet --ignore-exit-status --format short
|
|
volumes: *volumes
|
|
depends_on:
|
|
- 'dependencies and compile'
|
|
|
|
- name: sobelow check
|
|
image: *elixir
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y git make
|
|
- mix do local.rebar --force, local.hex --force
|
|
- mix sobelow
|
|
volumes: *volumes
|
|
depends_on:
|
|
- 'dependencies and compile'
|
|
|
|
- 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
|
|
volumes: *volumes
|
|
depends_on:
|
|
- 'test'
|
|
- 'audit deps'
|
|
- 'format check'
|
|
- 'credo check'
|
|
- 'dialyzer check'
|
|
- 'sobelow check'
|
|
|
|
services:
|
|
- name: *db_host
|
|
image: *postgres
|
|
environment:
|
|
POSTGRES_USER: *db_user
|
|
POSTGRES_PASSWORD: *db_pass
|
|
|
|
volumes:
|
|
- name: app_build
|
|
temp: {}
|
|
- name: app_deps
|
|
temp: {}
|