From 2cfd23ca1f1e7cdc7c738e1027a10215a9373035 Mon Sep 17 00:00:00 2001 From: Johanna Larsson Date: Fri, 3 Jul 2026 10:37:49 +0100 Subject: [PATCH] Set up a tangled CI workflow Using the new microvm engine to run postgres, with some postgres config to run over tcp instead of a unix socket to match the default Phoenix project setup. The steps match `mix precommit` but with the flags that make them fail instead of just fixing, eg `mix format --check-formatted` instead of just `mix format`. --- .tangled/workflows/ci.yml | 35 +++++++++++++++++++ .../controllers/live/posts_live.ex | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .tangled/workflows/ci.yml diff --git a/.tangled/workflows/ci.yml b/.tangled/workflows/ci.yml new file mode 100644 index 0000000..c092657 --- /dev/null +++ b/.tangled/workflows/ci.yml @@ -0,0 +1,35 @@ +when: + - event: ["push", "pull_request"] + branch: ["main"] + +engine: microvm +image: nixos + +dependencies: + - beam29Packages.elixir_1_20 + - beam29Packages.erlang + +services: + postgresql: + enable: true + enableTCPIP: true + authentication: | + host all all 127.0.0.1/32 trust + host all all ::1/128 trust + +steps: + - name: setup + command: | + mix local.hex --force + mix local.rebar --force + mix deps.get + - name: compile + command: mix compile --warnings-as-errors + - name: format + command: mix format --check-formatted + - name: credo + command: mix credo --strict + - name: test + command: mix test --warnings-as-errors + - name: unused + command: mix deps.unlock --check-unused diff --git a/lib/annot_at_web/controllers/live/posts_live.ex b/lib/annot_at_web/controllers/live/posts_live.ex index d9e3774..90f911e 100644 --- a/lib/annot_at_web/controllers/live/posts_live.ex +++ b/lib/annot_at_web/controllers/live/posts_live.ex @@ -106,7 +106,7 @@ defmodule AnnotAtWeb.PostsLive do {if publishing?(@publishing, entry), do: "Publishing…", else: "Publish"} No - date + date -- 2.51.2