From 5440b214c56cb67260a4f81ec910556030f99774 Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Tue, 14 Apr 2026 21:47:06 +0300 Subject: [PATCH 1/4] add coveralls --- .github/workflows/test.yml | 7 +++++++ mix.exs | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9754efa1..a28c8c00 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,7 @@ jobs: otp: 28 dialyzer: true lint: true + coverage: true # Plausible versions # - https://github.com/plausible/analytics/blob/master/.tool-versions @@ -97,6 +98,12 @@ jobs: if: ${{ matrix.lint }} - run: mix test --include slow + if: ${{ !matrix.coverage }} + + - run: mix coveralls.github --include slow + if: ${{ matrix.coverage }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Restore PLTs cache if: ${{ matrix.dialyzer }} diff --git a/mix.exs b/mix.exs index 92a19e1c..27acdaf7 100644 --- a/mix.exs +++ b/mix.exs @@ -16,7 +16,8 @@ defmodule Ch.MixProject do docs: docs(), package: package(), source_url: @source_url, - dialyzer: [plt_local_path: "plts", plt_core_path: "plts"] + dialyzer: [plt_local_path: "plts", plt_core_path: "plts"], + test_coverage: [tool: ExCoveralls] ] end @@ -27,6 +28,18 @@ defmodule Ch.MixProject do ] end + def cli do + [ + preferred_envs: [ + coveralls: :test, + "coveralls.detail": :test, + "coveralls.json": :test, + "coveralls.html": :test, + "coveralls.github": :test + ] + ] + end + # Specifies which paths to compile per environment. defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_env), do: ["lib"] @@ -46,7 +59,8 @@ defmodule Ch.MixProject do {:benchee, "~> 1.0", only: [:bench]}, {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}, {:ex_doc, ">= 0.0.0", only: :docs}, - {:tz, "~> 0.28.1", only: [:test]} + {:tz, "~> 0.28.1", only: [:test]}, + {:excoveralls, "~> 0.18.5", only: :test} ] end From bf632dfb852eaf8ad07dc174d68d4ddf3739f2c9 Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Tue, 14 Apr 2026 21:47:50 +0300 Subject: [PATCH 2/4] ignore support --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 27acdaf7..817ef6c5 100644 --- a/mix.exs +++ b/mix.exs @@ -17,7 +17,7 @@ defmodule Ch.MixProject do package: package(), source_url: @source_url, dialyzer: [plt_local_path: "plts", plt_core_path: "plts"], - test_coverage: [tool: ExCoveralls] + test_coverage: [tool: ExCoveralls, ignore_modules: [Ch.Test]] ] end From e6232b094ea8cc77a6e1f9870a624a90cd7f09f4 Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Tue, 14 Apr 2026 21:48:04 +0300 Subject: [PATCH 3/4] mix deps.get --- mix.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/mix.lock b/mix.lock index 92957b86..6e6758f4 100644 --- a/mix.lock +++ b/mix.lock @@ -8,6 +8,7 @@ "ecto": {:hex, :ecto, "3.13.5", "9d4a69700183f33bf97208294768e561f5c7f1ecf417e0fa1006e4a91713a834", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "df9efebf70cf94142739ba357499661ef5dbb559ef902b68ea1f3c1fabce36de"}, "erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"}, "ex_doc": {:hex, :ex_doc, "0.40.1", "67542e4b6dde74811cfd580e2c0149b78010fd13001fda7cfeb2b2c2ffb1344d", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "bcef0e2d360d93ac19f01a85d58f91752d930c0a30e2681145feea6bd3516e00"}, + "excoveralls": {:hex, :excoveralls, "0.18.5", "e229d0a65982613332ec30f07940038fe451a2e5b29bce2a5022165f0c9b157e", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "523fe8a15603f86d64852aab2abe8ddbd78e68579c8525ae765facc5eae01562"}, "hpax": {:hex, :hpax, "1.0.3", "ed67ef51ad4df91e75cc6a1494f851850c0bd98ebc0be6e81b026e765ee535aa", [:mix], [], "hexpm", "8eab6e1cfa8d5918c2ce4ba43588e894af35dbd8e91e6e55c817bca5847df34a"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, From dc264589822ecdcdd3168cdd9a80d9b61702d7b8 Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Tue, 14 Apr 2026 21:51:57 +0300 Subject: [PATCH 4/4] badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8f146d44..1f3089bd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Documentation badge](https://img.shields.io/badge/Documentation-ff69b4)](https://hexdocs.pm/ch) [![Hex.pm badge](https://img.shields.io/badge/Package%20on%20hex.pm-informational)](https://hex.pm/packages/ch) +[![Coverage Status](https://coveralls.io/repos/github/plausible/ch/badge.svg?branch=coveralls)](https://coveralls.io/github/plausible/ch?branch=coveralls) Minimal HTTP [ClickHouse](https://clickhouse.com) client for Elixir.