diff --git a/.dialyzer_ignore.exs b/.dialyzer_ignore.exs new file mode 100644 index 00000000..71ef7479 --- /dev/null +++ b/.dialyzer_ignore.exs @@ -0,0 +1,5 @@ +[ + {"test/support/channel_case.ex", :unknown_function}, + {"test/support/conn_case.ex", :unknown_function}, + {"test/support/data_case.ex", :unknown_function} +] diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 066732f5..a5099702 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -16,7 +16,7 @@ jobs: _build .cargo deps - key: ${{ runner.os }}-deps-2-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-deps-3-${{ hashFiles('mix.lock') }} - name: Enable caching run: | @@ -34,18 +34,6 @@ jobs: - name: Build and test run: docker compose run app run-test - - name: mix format - run: docker compose run app mix format --check-formatted - - - name: Security lint - run: | - docker compose run app mix sobelow --config - docker compose run app mix deps.audit - - - name: Dialyzer - run: | - docker compose run app mix dialyzer - typos: name: 'Check for spelling errors' runs-on: ubuntu-latest diff --git a/docker/app/run-test b/docker/app/run-test index e55fa838..f845890f 100755 --- a/docker/app/run-test +++ b/docker/app/run-test @@ -1,10 +1,14 @@ #!/usr/bin/env sh +set -e export MIX_ENV=test # Always install mix dependencies (cd /srv/philomena && mix deps.get) +# Run formatting check +mix format --check-formatted + # Sleep to allow OpenSearch to finish initializing # if it's not done doing whatever it does yet echo -n "Waiting for OpenSearch" @@ -21,4 +25,11 @@ mix ecto.create mix ecto.load # Test the application -exec mix test +mix test + +# Security lint +mix sobelow --config +mix deps.audit + +# Static analysis +exec mix dialyzer diff --git a/mix.exs b/mix.exs index 49a2e023..f9b58846 100644 --- a/mix.exs +++ b/mix.exs @@ -90,7 +90,7 @@ defmodule Philomena.MixProject do {:mix_audit, "~> 2.1", only: [:dev, :test], runtime: false}, # Static analysis - {:dialyxir, "~> 1.2", only: :dev, runtime: false}, + {:dialyxir, "~> 1.2", only: [:dev, :test], runtime: false}, # Fixes for Elixir v1.15+ {:canary, "~> 1.1",