Skip to content

Commit

Permalink
Force GH Actions workflows to use test env
Browse files Browse the repository at this point in the history
  • Loading branch information
liamwhite committed Jan 11, 2025
1 parent 02014c4 commit b794bd7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
@@ -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}
]
14 changes: 1 addition & 13 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down
13 changes: 12 additions & 1 deletion docker/app/run-test
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b794bd7

Please sign in to comment.