chore: reorder drone steps for speed improvements
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
acd6d79efe
commit
e959d069f2
1 changed files with 55 additions and 24 deletions
79
.drone.yml
79
.drone.yml
|
|
@ -28,33 +28,24 @@ steps:
|
|||
restore: true
|
||||
mount:
|
||||
- ./deps
|
||||
- ./_build
|
||||
- ./.hex-cache
|
||||
ttl: 30
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
|
||||
- name: lint
|
||||
- name: setup
|
||||
image: docker.io/library/elixir:1.18.3-otp-27
|
||||
depends_on:
|
||||
- restore-cache
|
||||
environment:
|
||||
HEX_HOME: ./.hex-cache
|
||||
MIX_HOME: ./.hex-cache
|
||||
commands:
|
||||
# Install hex package manager
|
||||
# Install hex package manager (uses cached .hex-cache if available)
|
||||
- mix local.hex --force
|
||||
# Fetch dependencies
|
||||
- mix deps.get
|
||||
# Check for compilation errors & warnings
|
||||
- mix compile --warnings-as-errors
|
||||
# Check formatting
|
||||
- mix format --check-formatted
|
||||
# Security checks
|
||||
- mix sobelow --config
|
||||
# Check dependencies for known vulnerabilities
|
||||
- mix deps.audit
|
||||
# Check for dependencies that are not maintained anymore
|
||||
- mix hex.audit
|
||||
# Provide hints for improving code quality
|
||||
- mix credo
|
||||
# Check that translations are up to date
|
||||
- mix gettext.extract --check-up-to-date
|
||||
|
||||
- name: wait_for_postgres
|
||||
image: docker.io/library/postgres:17.6
|
||||
|
|
@ -72,30 +63,70 @@ steps:
|
|||
echo "Postgres did not become available, aborting."
|
||||
exit 1
|
||||
|
||||
- name: compile
|
||||
image: docker.io/library/elixir:1.18.3-otp-27
|
||||
depends_on:
|
||||
- setup
|
||||
environment:
|
||||
HEX_HOME: ./.hex-cache
|
||||
MIX_HOME: ./.hex-cache
|
||||
commands:
|
||||
# Compile for dev (with warnings as errors) and test environments
|
||||
- mix compile --warnings-as-errors
|
||||
- MIX_ENV=test mix compile --warnings-as-errors
|
||||
|
||||
- name: lint
|
||||
image: docker.io/library/elixir:1.18.3-otp-27
|
||||
depends_on:
|
||||
- compile
|
||||
environment:
|
||||
HEX_HOME: ./.hex-cache
|
||||
MIX_HOME: ./.hex-cache
|
||||
commands:
|
||||
# Check formatting
|
||||
- mix format --check-formatted
|
||||
# Security checks
|
||||
- mix sobelow --config
|
||||
# Check dependencies for known vulnerabilities
|
||||
- mix deps.audit
|
||||
# Check for dependencies that are not maintained anymore
|
||||
- mix hex.audit
|
||||
# Provide hints for improving code quality
|
||||
- mix credo
|
||||
# Check that translations are up to date
|
||||
- mix gettext.extract --check-up-to-date
|
||||
|
||||
- name: test
|
||||
image: docker.io/library/elixir:1.18.3-otp-27
|
||||
depends_on:
|
||||
- compile
|
||||
- wait_for_postgres
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
TEST_POSTGRES_HOST: postgres
|
||||
TEST_POSTGRES_PORT: 5432
|
||||
HEX_HOME: ./.hex-cache
|
||||
MIX_HOME: ./.hex-cache
|
||||
commands:
|
||||
# Install hex package manager
|
||||
- mix local.hex --force
|
||||
# Fetch dependencies
|
||||
- mix deps.get
|
||||
# Run tests
|
||||
- mix test
|
||||
# Run tests with increased parallelism
|
||||
- mix test --max-cases 16
|
||||
|
||||
- name: rebuild-cache
|
||||
image: drillster/drone-volume-cache
|
||||
depends_on:
|
||||
- lint
|
||||
- test
|
||||
settings:
|
||||
rebuild: true
|
||||
mount:
|
||||
- ./deps
|
||||
- ./_build
|
||||
- ./.hex-cache
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue