Skip to content

Commit

Permalink
add ci (#4)
Browse files Browse the repository at this point in the history
* add ci

* support minimal version 1.12

* mix format

* add badges

* update license
  • Loading branch information
falood authored Aug 16, 2024
1 parent 5f075ae commit 070383b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
pull_request:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-20.04
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- pair:
elixir: 1.12
otp: 22.3
- pair:
elixir: 1.17
otp: 27

steps:
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}

- uses: actions/checkout@v4

- run: mix deps.get
- run: mix format --check-formatted
- run: mix deps.unlock --check-unused
- run: mix deps.compile
- run: mix compile --warnings-as-errors
- run: mix test
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Maru Params
> A rebuild version of maru params parser which support phoenix framework.
[![Module Version](https://img.shields.io/hexpm/v/maru_params.svg)](https://hex.pm/packages/maru_params)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/maru_params/)
[![Total Download](https://img.shields.io/hexpm/dt/maru_params.svg)](https://hex.pm/packages/maru_params)
[![License](https://img.shields.io/hexpm/l/maru_params.svg)](https://github.com/falood/maru_params/blob/master/LICENSE)
[![Last Updated](https://img.shields.io/github/last-commit/falood/maru_params.svg)](https://github.com/falood/maru_params/commits/master)
[![CI](https://github.com/falood/maru_params/actions/workflows/ci.yml/badge.svg)](https://github.com/falood/maru_params/actions)

## Installation

```elixir
Expand Down
4 changes: 3 additions & 1 deletion lib/maru/params/types/boolean.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ defmodule Maru.Params.Types.Boolean do
def parse(nil, _), do: {:ok, false}
def parse(false, _), do: {:ok, false}
def parse("false", _), do: {:ok, false}
def parse(input, _), do: {:error, :parse, "unknown format, expected Boolean, got: #{inspect(input)}"}

def parse(input, _),
do: {:error, :parse, "unknown format, expected Boolean, got: #{inspect(input)}"}
end
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule MaruParams.MixProject do
[
app: :maru_params,
version: "0.2.10",
elixir: "~> 1.2",
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -40,7 +40,7 @@ defmodule MaruParams.MixProject do
defp package do
%{
maintainers: ["Xiangrong Hao"],
licenses: ["WTFPL"],
licenses: ["Apache 2.0"],
links: %{"Github" => "https://github.com/elixir-maru/maru_params"}
}
end
Expand Down

0 comments on commit 070383b

Please # to comment.