ex_trainer/.drone.yml
Joao P Dubas 9bd41ba3b8
All checks were successful
continuous-integration/drone/push Build is passing
chore(deps): bump erlang runtime and deps (#67)
Update runtime:

* Bump [`erlang` from 26.2.2 to 26.2.3][0]

Update [dependencies][1]:

* credo from 1.7.4 to 1.7.5
* mix_audit from 2.1.2 to 2.1.3
* phoenix_ecto from 4.4.3 to 4.5.1
* postgrex from 0.17.4 to 0.17.5

[0]: https://www.erlang.org/patches/otp-26.2.3
[1]: https://diff.hex.pm/diffs?diffs[]=credo:1.7.4:1.7.5&diffs[]=mix_audit:2.1.2:2.1.3&diffs[]=phoenix_ecto:4.4.5:4.5.1&diffs[]=postgrex:0.17.4:0.17.5

Reviewed-on: #67
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-03-19 16:23:27 +00:00

167 lines
4.1 KiB
YAML

---
kind: pipeline
type: docker
name: test
trigger:
branch:
- main
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.2-erlang-26.2.3-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