Skip to content

Commit d901a02

Browse files
committed
run check with ex_check in ci, fix elixir version
1 parent 85b946f commit d901a02

4 files changed

Lines changed: 58 additions & 17 deletions

File tree

.check.exs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
## don't run tools concurrently
3+
# parallel: false,
4+
5+
## don't print info about skipped tools
6+
# skipped: false,
7+
8+
## always run tools in fix mode (put it in ~/.check.exs locally, not in project config)
9+
# fix: true,
10+
11+
## don't retry automatically even if last run resulted in failures
12+
retry: false,
13+
14+
## list of tools (see `mix check` docs for a list of default curated tools)
15+
tools: [
16+
## curated tools may be disabled (e.g. the check for compilation warnings)
17+
{:gettext, false}
18+
19+
## ...or have command & args adjusted (e.g. enable skip comments for sobelow)
20+
# {:sobelow, "mix sobelow --exit --skip"},
21+
22+
## ...or reordered (e.g. to see output from dialyzer before others)
23+
# {:dialyzer, order: -1},
24+
25+
## ...or reconfigured (e.g. disable parallel execution of ex_unit in umbrella)
26+
# {:ex_unit, umbrella: [parallel: false]},
27+
28+
## custom new tools may be added (Mix tasks or arbitrary commands)
29+
# {:my_task, "mix my_task", env: %{"MIX_ENV" => "prod"}},
30+
# {:my_tool, ["my_tool", "arg with spaces"]}
31+
]
32+
]

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: push
55
jobs:
66
mix_check:
77
name: mix check
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99

1010
steps:
1111
- name: Checkout
@@ -29,7 +29,4 @@ jobs:
2929
run: mix setup
3030

3131
- name: Run check
32-
run: mix check --except dialyzer
33-
34-
- name: Run dialyzer
35-
run: mix dialyzer
32+
run: mix check

mix.exs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@ defmodule Knigge.MixProject do
77
[
88
app: :knigge,
99
config_path: "config/config.exs",
10-
elixir: ">= 1.18 and < 2.0.0",
10+
elixir: ">= 1.18.0 and < 2.0.0",
1111
elixirc_paths: elixirc_paths(Mix.env()),
12-
preferred_cli_env: [
13-
coveralls: :test,
14-
"coveralls.detail": :test,
15-
"coveralls.post": :test,
16-
"coveralls.html": :test,
17-
"check.all": :test
18-
],
1912
test_coverage: [tool: ExCoveralls],
2013
start_permanent: Mix.env() == :prod,
2114
aliases: aliases(),
@@ -37,6 +30,25 @@ defmodule Knigge.MixProject do
3730
]
3831
end
3932

33+
def cli do
34+
[
35+
# https://github.com/lpil/mix-test.watch?tab=readme-ov-file#usage
36+
# https://hexdocs.pm/ex_check/readme.html#duplicate-builds
37+
preferred_envs: [
38+
coveralls: :test,
39+
"coveralls.detail": :test,
40+
"coveralls.post": :test,
41+
"coveralls.html": :test,
42+
check: :test,
43+
credo: :test,
44+
dialyzer: :test,
45+
docs: :test,
46+
format: :test,
47+
"test.watch": :test
48+
]
49+
]
50+
end
51+
4052
defp elixirc_paths(:test), do: ["lib", "test/support"]
4153
defp elixirc_paths(_), do: ["lib"]
4254

@@ -50,9 +62,7 @@ defmodule Knigge.MixProject do
5062
# Aliases are shortcuts or tasks specific to the current project.
5163
# See the documentation for `Mix` for more info on aliases.
5264
defp aliases do
53-
[
54-
"check.all": ["format --check-formatted", "credo", "dialyzer", "test"]
55-
]
65+
[]
5666
end
5767

5868
# Run "mix help deps" to learn about dependencies.
@@ -61,9 +71,10 @@ defmodule Knigge.MixProject do
6171
{:bunt, "~> 1.0", runtime: false},
6272

6373
# No Runtime
74+
{:ex_check, "~> 0.16.0", only: [:dev, :test], runtime: false},
6475
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
6576
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
66-
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
77+
{:ex_doc, ">= 0.0.0", only: [:dev, :test], runtime: false},
6778

6879
# Test
6980
{:excoveralls, "~> 0.13", only: :test},

mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
55
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
66
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
7+
"ex_check": {:hex, :ex_check, "0.16.0", "07615bef493c5b8d12d5119de3914274277299c6483989e52b0f6b8358a26b5f", [:mix], [], "hexpm", "4d809b72a18d405514dda4809257d8e665ae7cf37a7aee3be6b74a34dec310f5"},
78
"ex_doc": {:hex, :ex_doc, "0.38.2", "504d25eef296b4dec3b8e33e810bc8b5344d565998cd83914ffe1b8503737c02", [: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", "732f2d972e42c116a70802f9898c51b54916e542cc50968ac6980512ec90f42b"},
89
"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"},
910
"file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"},

0 commit comments

Comments
 (0)