Merge pull request #399 from philomena-dev/workflow-mix-env

Force GH Actions workflows to use test env
This commit is contained in:
liamwhite 2025-01-11 14:01:48 -05:00 committed by GitHub
commit 77ed150dd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 15 deletions

5
.dialyzer_ignore.exs Normal file
View file

@ -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}
]

View file

@ -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

View file

@ -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

View file

@ -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",