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
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,36 @@ jobs:
- name: Run the checks
run: mix check

coverage:
name: Coverage
runs-on: ubuntu-latest
permissions:
id-token: write
env:
MIX_ENV: test
steps:
- name: Clone the repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup the Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Setup the environment
run: nix build -L --no-link .#devShells.x86_64-linux.ci-minimal
- name: Fetch the dependencies
run: nix develop .#ci-minimal -c mix deps.get
- name: Build the dependencies
run: nix develop .#ci-minimal -c mix deps.compile
- name: Generate the test coverage report
run: nix develop .#ci-minimal -c mix coveralls.lcov
- name: Upload the test coverage report
uses: codecov/codecov-action@v5
with:
disable_search: true
files: ./cover/lcov.info
fail_ci_if_error: true
use_oidc: true

docs:
name: Documentation
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"jnoortheen.nix-ide",
"ryanluker.vscode-coverage-gutters",
"tamasfe.even-better-toml",
"tekumara.typos-vscode"
]
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"coverage-gutters.coverageBaseDir": "cover",
"coverage-gutters.coverageReportFileName": "cover/excoveralls.html",
"coverage-gutters.watchOnActivate": true,
"editor.formatOnSave": true,
"editor.rulers": [80],
"evenBetterToml.taplo.bundled": false,
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/typed_struct/)
[![Total Download](https://img.shields.io/hexpm/dt/typed_struct.svg)](https://hex.pm/packages/typed_struct)
[![License](https://img.shields.io/hexpm/l/typed_struct.svg)](https://github.com/ejpcmac/typed_struct/blob/master/LICENSE.md)<br>
[![codecov](https://codecov.io/gh/ejpcmac/typed_struct/graph/badge.svg?token=riJ8O4G501)](https://codecov.io/gh/ejpcmac/typed_struct)
[![Test Status](https://github.com/ejpcmac/typed_struct/actions/workflows/ci.yml/badge.svg)
](https://github.com/ejpcmac/typed_struct/actions/workflows/ci.yml)

Expand Down
15 changes: 15 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
codecov:
branch: develop

coverage:
status:
project:
default:
target: auto
threshold: 1%
patch:
default:
target: 100%

comment:
layout: "diff, files, components"
16 changes: 0 additions & 16 deletions config/config.exs

This file was deleted.

21 changes: 21 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,27 @@

env =
ideEnv;

commands = [
# NOTE: Install `mix_test_interactive` via Nix since we cannot
# depend on in via Mix beauce it depends on `typed_struct`.
{
name = "mti_exec";
command = ''
#!/usr/bin/env elixir

Mix.install([
{:mix_test_interactive, "~> 4.1"}
])

MixTestInteractive.run(System.argv())
'';
}
{
name = "live-coverage";
command = "mti_exec --clear --task coveralls.lcov";
}
];
};

ci-committed = {
Expand Down
1 change: 1 addition & 0 deletions git-z.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ list = [
"version",

# Tools
"codecov",
"committed",
"credo",
"dialyzer",
Expand Down
5 changes: 1 addition & 4 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ defmodule TypedStruct.MixProject do
{:credo, "~> 1.0", only: :dev, runtime: false},
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
{:excoveralls, ">= 0.0.0", only: :test, runtime: false},
{:mix_test_watch, ">= 0.0.0", only: :test, runtime: false},
{:ex_unit_notifier, ">= 0.0.0", only: :test, runtime: false},

# Project dependencies
Expand Down Expand Up @@ -94,13 +93,11 @@ defmodule TypedStruct.MixProject do

defp cli_env do
[
# Run mix test.watch in `:test` env.
"test.watch": :test,

# Always run Coveralls Mix tasks in `:test` env.
coveralls: :test,
"coveralls.detail": :test,
"coveralls.html": :test,
"coveralls.lcov": :test,

# Use a custom env for docs.
docs: :docs
Expand Down
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
"mix_test_watch": {:hex, :mix_test_watch, "1.3.0", "2ffc9f72b0d1f4ecf0ce97b044e0e3c607c3b4dc21d6228365e8bc7c2856dc77", [:mix], [{:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "f9e5edca976857ffac78632e635750d158df14ee2d6185a15013844af7570ffe"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
}
Loading