From 2824b7c30b19a1577861072a3c77639e91ce0fce Mon Sep 17 00:00:00 2001 From: treejamie Date: Wed, 29 Apr 2026 15:28:28 +0100 Subject: [PATCH 1/4] feat: added in credo and dialyzer --- mix.exs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 26dc738..33efcdc 100644 --- a/mix.exs +++ b/mix.exs @@ -9,10 +9,17 @@ defmodule App.MixProject do elixir: "~> 1.18", start_permanent: Mix.env() == :prod, deps: deps(), + aliases: aliases(), escript: [main_module: Server] ] end + defp aliases do + [ + check: ["format --check-formatted", "credo --strict", "dialyzer", "test"] + ] + end + # Run "mix help compile.app" to learn about applications. def application do [ @@ -24,8 +31,8 @@ defmodule App.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - # {:dep_from_hexpm, "~> 0.3.0"}, - # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} + {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, + {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false} ] end end From 9be17dbe8a4ce4899409111aee3252d905f94090 Mon Sep 17 00:00:00 2001 From: treejamie Date: Wed, 29 Apr 2026 15:35:04 +0100 Subject: [PATCH 2/4] ci: added in a config to run tests on every push --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f82d6fb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches-ignore: + - main + +env: + MIX_ENV: test + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: "1.18" + otp-version: "27" + + - name: Cache deps + uses: actions/cache@v4 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + + - name: Cache build + uses: actions/cache@v4 + with: + path: _build + key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-build- + + - name: Install dependencies + run: mix deps.get + + - name: Run credo and dialyzer + run: mix check + - name: Run tests + run: mix test From 9ba70c13124e42564bf89f47a738484262adf47a Mon Sep 17 00:00:00 2001 From: treejamie Date: Wed, 29 Apr 2026 15:35:44 +0100 Subject: [PATCH 3/4] chore: added in mix.lock --- mix.lock | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 mix.lock diff --git a/mix.lock b/mix.lock new file mode 100644 index 0000000..64f234c --- /dev/null +++ b/mix.lock @@ -0,0 +1,8 @@ +%{ + "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, + "credo": {:hex, :credo, "1.7.18", "5c5596bf7aedf9c8c227f13272ac499fe8eae6237bd326f2f07dfc173786f042", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "a189d164685fd945809e862fe76a7420c4398fa288d76257662aecb909d6b3e5"}, + "dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"}, + "erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"}, + "file_system": {:hex, :file_system, "1.1.1", "31864f4685b0148f25bd3fbef2b1228457c0c89024ad67f7a81a3ffbc0bbad3a", [:mix], [], "hexpm", "7a15ff97dfe526aeefb090a7a9d3d03aa907e100e262a0f8f7746b78f8f87a5d"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, +} From 512855269fa4b73a7cdf19746c34e386eba0b26a Mon Sep 17 00:00:00 2001 From: treejamie Date: Wed, 29 Apr 2026 15:36:45 +0100 Subject: [PATCH 4/4] typo: fixed typo in test.yml --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f82d6fb..5426df3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,4 @@ name: CI - on: push: branches-ignore: