From 71142e70abed8194aa1b47f273ed810491aaaccb Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Tue, 22 Mar 2022 09:19:05 -0300 Subject: [PATCH 1/5] fix warnings_as_errors and compile deps --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9182b580..d43e1ab3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: push: branches: - main + - misc jobs: mix_test: @@ -63,7 +64,6 @@ jobs: if: steps.deps-cache.outputs.cache-hit != 'true' - run: mix format --check-formatted if: matrix.check_formatted - - run: mix compile --warnings-as-errors - if: matrix.warnings_as_errors + - run: mix compile --warnings-as-errors=${{matrix.warnings_as_errors || false}} - name: mix test run: mix test --include integration:${{ !!matrix.run_integration_tests }} --exclude plugin:${{ !matrix.run_plugin_tests }} From 93f435ac2be359055897414c0a73844d9b3a8d69 Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Fri, 12 Jan 2024 07:46:47 -0300 Subject: [PATCH 2/5] print erlang version --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d43e1ab3..f478026b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,8 @@ jobs: with: otp-version: ${{matrix.otp}} elixir-version: ${{matrix.elixir}} + - name: Erlang version + run: erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell - name: Deps and _build cache uses: actions/cache@v3 id: deps-cache @@ -59,6 +61,7 @@ jobs: run: | mix local.hex --force mix local.rebar --force + elixir --version mix deps.get --only test - run: mix deps.compile if: steps.deps-cache.outputs.cache-hit != 'true' From 3258879a547703f50f0e9f670da9ff079bf86a5a Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Fri, 12 Jan 2024 08:32:04 -0300 Subject: [PATCH 3/5] test 'warning: ' --- test/mix/tasks/compile/surface_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mix/tasks/compile/surface_test.exs b/test/mix/tasks/compile/surface_test.exs index aaf44b8b..5e614151 100644 --- a/test/mix/tasks/compile/surface_test.exs +++ b/test/mix/tasks/compile/surface_test.exs @@ -79,7 +79,7 @@ defmodule Mix.Tasks.Compile.SurfaceTest do assert {:ok, [^diagnostic]} = handle_diagnostics([diagnostic], []) end) - assert output =~ IO.ANSI.format([:yellow, "warning:"]) |> IO.iodata_to_binary() + assert output =~ IO.ANSI.format([:yellow, "warning: "]) |> IO.iodata_to_binary() assert output =~ "test warning\n file.ex:1: (file)\n\n" end From 1c92536d22e6d47fc44a523967aa4ef3b96b8128 Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Fri, 12 Jan 2024 08:38:19 -0300 Subject: [PATCH 4/5] test2 for 'warning: ' --- test/mix/tasks/compile/surface_test.exs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/mix/tasks/compile/surface_test.exs b/test/mix/tasks/compile/surface_test.exs index 5e614151..7f6f72b6 100644 --- a/test/mix/tasks/compile/surface_test.exs +++ b/test/mix/tasks/compile/surface_test.exs @@ -80,6 +80,8 @@ defmodule Mix.Tasks.Compile.SurfaceTest do end) assert output =~ IO.ANSI.format([:yellow, "warning: "]) |> IO.iodata_to_binary() + assert output =~ IO.ANSI.format([:yellow, "warning:"]) |> IO.iodata_to_binary() + assert output == "what?" assert output =~ "test warning\n file.ex:1: (file)\n\n" end From f3e7652c170b7fee37f737fa0396ce73546e1ddd Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Fri, 12 Jan 2024 08:49:31 -0300 Subject: [PATCH 5/5] test3 for 'warning: ' --- test/mix/tasks/compile/surface_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mix/tasks/compile/surface_test.exs b/test/mix/tasks/compile/surface_test.exs index 7f6f72b6..a37ec06e 100644 --- a/test/mix/tasks/compile/surface_test.exs +++ b/test/mix/tasks/compile/surface_test.exs @@ -78,7 +78,7 @@ defmodule Mix.Tasks.Compile.SurfaceTest do capture_io(:standard_error, fn -> assert {:ok, [^diagnostic]} = handle_diagnostics([diagnostic], []) end) - + IO.inspect(output) assert output =~ IO.ANSI.format([:yellow, "warning: "]) |> IO.iodata_to_binary() assert output =~ IO.ANSI.format([:yellow, "warning:"]) |> IO.iodata_to_binary() assert output == "what?"