From 2039b43c53a1211c6ba81e0e4baa499af854c95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Dubas?= Date: Sun, 23 Jul 2023 23:01:03 +0000 Subject: [PATCH] feat: upgrade elixir/erlang runtimes (#35) Upgrade runtimes to the latest versions: * elixir to 1.15.4 * erlang to 26.0.2 Improve CI definition by using a cache that considers the runtime version. Save disk space by using the `slim` image variant. Co-authored-by: Joao P Dubas Reviewed-on: https://gitea.dubas.dev/joao.dubas/ex_trainer/pulls/35 --- .drone.yml | 16 ++++++++++------ .tool-versions | 4 ++-- docker-compose.yml | 4 +--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index eb0dd88..8d95fd4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,7 +27,7 @@ steps: settings: archive_format: gzip bucket: trainlog-cache - cache_key: '{{ .Repo.Name }}-{{ checksum "mix.lock" }}' + cache_key: '{{ .Repo.Name }}-{{ checksum ".tool-versions" }}-{{ checksum "mix.lock" }}' endpoint: minio:9000 mount: - _build @@ -37,7 +37,7 @@ steps: restore: true - name: test - image: 'elixir:1.14.5' + image: 'elixir:1.15.4-slim' environment: MIX_ENV: test POSTGRES_HOST: db @@ -45,13 +45,17 @@ steps: POSTGRES_PASS: postgres commands: - mix do local.rebar --force, local.hex --force, deps.get, deps.compile - - make test + - mix compile + - mix test --cover --trace --slowest 10 - name: lint - image: 'elixir:1.14.5' + image: 'elixir:1.15.4-slim' commands: - mix do local.rebar --force, local.hex --force, deps.get, deps.compile - - make static_code_analysis + - mix compile + - mix format --check-formatted + - mix credo suggest --strict --format=flycheck + - mix dialyzer --no-check --quiet --ignore-exit-status --format short - name: rebuild cache image: 'meltwater/drone-cache:v1.4.0' @@ -63,7 +67,7 @@ steps: settings: archive_format: gzip bucket: trainlog-cache - cache_key: '{{ .Repo.Name }}-{{ checksum "mix.lock" }}' + cache_key: '{{ .Repo.Name }}-{{ checksum ".tool-versions" }}-{{ checksum "mix.lock" }}' endpoint: minio:9000 exit_code: true mount: diff --git a/.tool-versions b/.tool-versions index 5b25d50..44acbf0 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -erlang 24.3.4 -elixir 1.15.0 +erlang 26.0.2 +elixir 1.15.4 diff --git a/docker-compose.yml b/docker-compose.yml index db136b0..09244a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,4 @@ --- -version: '3.7' - services: db: image: 'postgres:15.3-alpine' @@ -15,7 +13,7 @@ services: - 'db_data:/var/lib/postgresql/data' restart: unless-stopped app: - image: 'elixir:1.14.5' + image: 'elixir:1.15.4-slim' hostname: app depends_on: - db