Upgrade project runtimes and dependencies to the latest versions. 1. Runtimes: 1. `elixir` to 1.16.1 1. `erlang` to 26.2.2 1. [Dependencies][0]: 1. `absinte` from 1.7.5 to 1.7.6 1. `credo` from 1.7.1 to 1.7.4 1. `dialyxir` from 1.4.2 to 1.4.3 1. `ecto_sql` from 3.10.3 to 3.11.1 1. `gettext` from 0.23.1 to 0.24.0 1. `mix_audit` from 2.1.1 to 2.1.2 1. `pg_ranges` from 1.1.0 to 1.1.1 1. `phoenix` from 1.7.10 to 1.7.11 1. `plug_cowboy` from 2.6.1 to 2.7.0 1. `postgrex` from 0.17.3 to 0.17.4 1. `telemetry_metrics` from 0.6.1 to 0.6.2 [0]: https://diff.hex.pm/diffs?diffs[]=absinte:1.7.5:1.7.6&diffs[]=credo:1.7.1:1.7.4&diffs[]=dialyxir:1.4.2:1.4.3&diffs[]=ecto_sql:3.10.3:3.11.1&diffs[]=gettext:0.23.1:0.24.0&diffs[]=mix_audit:2.1.1:2.1.2&diffs[]=pg_ranges:1.1.0:1.1.1&diffs[]=phoenix:1.7.10:1.7.11&diffs[]=plug_cowboy:2.6.1:2.7.0&diffs[]=postgrex:0.17.3:0.17.4&diffs[]=telemetry_metrics:0.6.1:0.6.2 Reviewed-on: #60
167 lines
4.1 KiB
YAML
167 lines
4.1 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: test
|
|
|
|
trigger:
|
|
event:
|
|
- pull_request
|
|
|
|
steps:
|
|
- name: database healthcheck
|
|
image: &postgres 'postgres:16.0-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
|
|
|
|
- name: test
|
|
image: &elixir 'hexpm/elixir:1.16.1-erlang-26.2.2-debian-bookworm-20240130-slim'
|
|
environment:
|
|
MIX_ENV: test
|
|
POSTGRES_HOST: db
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASS: postgres
|
|
commands:
|
|
- mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
|
- mix compile
|
|
- mix test --cover --trace --slowest 10
|
|
|
|
- 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
|
|
|
|
services:
|
|
- name: db
|
|
image: *postgres
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
---
|
|
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 'elixir:1.15.7-slim'
|
|
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:
|
|
- apt-get update
|
|
- apt-get install -y git
|
|
- 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
|