Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ci #4

Merged
merged 5 commits into from
Aug 16, 2024
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
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