Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
# Onchain modules
~r/Function Onchain\./,
# Descripex (Discoverable macro)
~r/Function Descripex\./
~r/Function Descripex\./,
# ExRLP (via onchain → cartouche; transitive, only surfaces in test env via test/support)
~r/Function ExRLP\./
]
77 changes: 77 additions & 0 deletions .github/workflows/harness.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Deterministic Elixir harness gate for PRs.
# Closes the Codex-env-blocked-hex.pm gap: every PR push gets format / compile /
# credo / doctor / sobelow / test+cover / dialyzer evidence as PR checks, instead
# of needing a local reviewer to fetch the branch and run the suite.
#
# Versions are sourced from `.tool-versions` (asdf format) at the repo root via
# `setup-beam` — guarantees CI and local dev never drift on `mix format` output.

name: Harness

on:
pull_request:
branches: [main]
push:
branches: [main]

permissions:
contents: read

concurrency:
group: harness-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
harness:
name: Harness
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
Comment on lines +28 to +30
- uses: actions/checkout@v4

- id: beam
uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict

- name: Cache deps & _build (covers dialyxir PLT default path)
uses: actions/cache@v4
with:
path: |
deps
_build
priv/plts
key: mix-${{ runner.os }}-otp${{ steps.beam.outputs.otp-version }}-elixir${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-${{ runner.os }}-otp${{ steps.beam.outputs.otp-version }}-elixir${{ steps.beam.outputs.elixir-version }}-

- run: mix deps.get

- name: Compile (warnings as errors)
run: mix compile --warnings-as-errors

- name: Format check
run: mix format --check-formatted

# TODO/FIXME tags are tracked-debt visibility, not regressions — exclude
# so harness only fails on real Credo issues (see development-philosophy.md
# § "TODO Comment Requirements").
Comment on lines +59 to +60
- name: Credo (strict, excluding TODO/FIXME design tags)
run: mix credo --strict --ignore TagTODO,TagFIXME

- name: Doctor (--raise overrides .doctor.exs raise=false to gate CI)
run: mix doctor --raise

- name: Sobelow (honors .sobelow-conf, exit=Low)
run: mix sobelow
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make Sobelow fail the harness on findings

As written, this step only reports Sobelow results; it does not gate the PR when findings are present. Sobelow's task docs list --exit as the option that returns a non-zero exit status, and this repo has no .sobelow-conf to supply that option, so a PR introducing a Low/Medium/High finding would still pass this job. Add --exit Low or save an equivalent config if this harness is meant to block security findings.

Useful? React with 👍 / 👎.


# Coverage floor: 70% — main currently sits at ~74%; raise the floor as
# coverage climbs. `mix test.json`'s test_helper excludes `:integration`
# by default, so we don't need `--exclude integration` here.
- name: Tests + coverage gate (>=70%)
run: mix test.json --cover --cover-threshold 70 --summary-only

- name: Dialyzer
run: mix dialyzer
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
erlang 27.3.4.11
elixir 1.18.4-otp-27
Loading