Set up basic CI
This commit is contained in:
parent
86437cbb9d
commit
a8504a7fd6
5 changed files with 44 additions and 8 deletions
37
.drone.yml
37
.drone.yml
|
|
@ -2,9 +2,36 @@ kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
|
services:
|
||||||
|
- name: postgres
|
||||||
|
image: docker.io/library/postgres:17.2
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: greeting
|
- name: lint & test
|
||||||
image: alpine
|
image: docker.io/library/elixir:1.18.3-otp-27
|
||||||
commands:
|
environment:
|
||||||
- echo hello
|
MIX_ENV: test
|
||||||
- echo world
|
TEST_POSTGRES_HOST: postgres
|
||||||
|
commands:
|
||||||
|
# Install hex package manager
|
||||||
|
- 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
|
||||||
|
# Wait for postgres to become available
|
||||||
|
# TODO: pg_isready is not installed in the elixir image
|
||||||
|
# - |
|
||||||
|
# for i in {1..20}; do
|
||||||
|
# pg_isready -h postgres -p $DATABASE_PORT && break
|
||||||
|
# sleep 2
|
||||||
|
# done
|
||||||
|
# echo "Postgres did not become available, aborting"
|
||||||
|
# exit 1
|
||||||
|
# Run tests
|
||||||
|
- mix test
|
||||||
|
|
|
||||||
5
.editorconfig
Normal file
5
.editorconfig
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
6
Justfile
6
Justfile
|
|
@ -8,4 +8,8 @@ migrate-database:
|
||||||
mix ash.setup
|
mix ash.setup
|
||||||
|
|
||||||
reset-database:
|
reset-database:
|
||||||
mix ash.reset
|
mix ash.reset
|
||||||
|
|
||||||
|
ci-dev:
|
||||||
|
mix compile --warnings-as-errors
|
||||||
|
mix format --check-formatted
|
||||||
|
|
@ -8,7 +8,7 @@ import Config
|
||||||
config :mv, Mv.Repo,
|
config :mv, Mv.Repo,
|
||||||
username: "postgres",
|
username: "postgres",
|
||||||
password: "postgres",
|
password: "postgres",
|
||||||
hostname: "localhost",
|
hostname: System.get_env("TEST_POSTGRES_HOST", "localhost"),
|
||||||
database: "mv_test#{System.get_env("MIX_TEST_PARTITION")}",
|
database: "mv_test#{System.get_env("MIX_TEST_PARTITION")}",
|
||||||
pool: Ecto.Adapters.SQL.Sandbox,
|
pool: Ecto.Adapters.SQL.Sandbox,
|
||||||
pool_size: System.schedulers_online() * 2
|
pool_size: System.schedulers_online() * 2
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" class="[scrollbar-gutter:stable]">
|
<html lang="en" class="[scrollbar-gutter:stable]">
|
||||||
<head>
|
<head>
|
||||||
<%= Application.get_env(:live_debugger, :live_debugger_tags) %>
|
{Application.get_env(:live_debugger, :live_debugger_tags)}
|
||||||
|
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue