Skip to content

Commit

Permalink
Prepare for publish (#9)
Browse files Browse the repository at this point in the history
* Add more test environments

* Rework read me

* Up release

* Fix CI name

* Fix master branch name

* Fix workflow

* Revert "Fix workflow"

This reverts commit b43c233.

* Remove cache

* Fix URLs in read me

* Typo

* Temporary disable lint

* Downgrade lint plugin

* Add usage and extent link description

* Try to fix build

* Update README.md

Co-authored-by: Alexey <[email protected]>

* Restore rebar3 cache

* Typo

* Fix cache name for MacOS

* Remove MacOS tests

* Add plugin versions

Co-authored-by: Alexey <[email protected]>
  • Loading branch information
kpy3 and kehitt authored Dec 22, 2020
1 parent be90c6e commit 8817fcd
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 30 deletions.
61 changes: 36 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
name: Erlang CI
name: CI

on: [push]

env:
ERLANG_VERSION: 21.3.8.12
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'

jobs:
build:
runs-on: ubuntu-latest
container: erlang:21.3.8.12
linux:
name: Test on OTP ${{ matrix.otp_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
otp_version: [21, 22, 23]
os: [ubuntu-latest]

container:
image: erlang:${{ matrix.otp_version }}

steps:
- uses: actions/checkout@v2
steps:
- uses: actions/checkout@v2

- name: Restore rebar3 chache
uses: actions/cache@v1
with:
path: ~/.cache/rebar3
key: rebar3-${{ env.ERLANG_VERSION }}
- name: Restore rebar3 cache
uses: actions/cache@v1
with:
path: ~/.cache/rebar3
key: rebar3-${{ matrix.otp_version }}

- name: Lint
run: rebar3 lint
- name: Lint
run: rebar3 lint

- name: Compile
run: rebar3 compile
- name: Compile
run: rebar3 compile

- name: Xref
run: rebar3 xref
- name: Xref
run: rebar3 xref

- name: Dialyze
run: rebar3 dialyzer
- name: Dialyze
run: rebar3 dialyzer

- name: Run tests
run: rebar3 do eunit, proper
- name: Run tests
run: rebar3 do eunit, proper
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# email_validator
Email validator for Erlang
==========================

Library for email address validation based on [RFC5321 (Simple Mail Transfer Protocol)](https://tools.ietf.org/rfc/rfc5321.txt) specification
[![Build Status](https://github.com/rbkmoney/email_validator/workflows/CI/badge.svg)](https://github.com/rbkmoney/email_validator/actions?query=branch%3Amaster+workflow%3A"CI") [![Erlang Versions](https://img.shields.io/badge/Supported%20Erlang%2FOTP-21.0%20to%2023.0-blue)](http://www.erlang.org)

Library for email address validation based on [RFC5321 (Simple Mail Transfer Protocol)](https://tools.ietf.org/rfc/rfc5321.txt)
with support for UTF-8 email headers ([RFC6532](https://tools.ietf.org/rfc/rfc6532.txt), [RFC6531](https://tools.ietf.org/rfc/rfc6531.txt))
and stricter IP address grammar ([RFC3986](https://tools.ietf.org/html/rfc3986#appendix-A)).

Using the library
-----------------
Add library as dependency in `rebar.config`

{deps, [
{email_validator, "1.0.0"}
...
]}.

Add `email_validator` as application dependency

{application, app,
[
{applications, [
...
email_validator
]},
...
]}.

Use `email_validator:validate/1` for email validation.
5 changes: 4 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@

{deps, []}.

{plugins, [rebar3_abnf_compiler, rebar3_lint, rebar3_proper]}.
{plugins, [
{rebar3_abnf_compiler, "0.1.2"},
{rebar3_lint, "0.2.0"},
{rebar3_proper, "0.12.1"}]}.

{profiles,
[{test, [
Expand Down
4 changes: 2 additions & 2 deletions src/email_validator.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, email_validator, [
{description, "A library to validate email address format based on RFC5321."},
{vsn, "0.1.0"},
{description, "A library to validate email address format."},
{vsn, "1.0.0"},
{applications, [
kernel,
stdlib
Expand Down

0 comments on commit 8817fcd

Please sign in to comment.