Skip to content

Commit 52a3754

Browse files
authored
Merge pull request #59 from maykonmichel/feature/#58
feature/#58
2 parents 2c7768a + d19b975 commit 52a3754

File tree

6 files changed

+121
-7
lines changed

6 files changed

+121
-7
lines changed

.circleci/config.yml

+101-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,88 @@
11
version: 2
22
jobs:
3-
build:
3+
build_test:
4+
docker:
5+
- image: circleci/elixir:1.9.4
6+
environment:
7+
MIX_ENV: test
8+
steps:
9+
- checkout
10+
- run: mix local.hex --force
11+
- run: mix local.rebar --force
12+
- restore_cache:
13+
key: v1-deps-cache-{{ checksum "mix.lock" }}
14+
- run: mix do deps.get, deps.compile
15+
- save_cache:
16+
key: v1-deps-cache-{{ checksum "mix.lock" }}
17+
paths:
18+
- deps
19+
- ~/.mix
20+
- _build
21+
- run: mix compile
22+
- run: echo "$OTP_VERSION $ELIXIR_VERSION" > .version_file
23+
- restore_cache:
24+
keys:
25+
- plt-cache-{{ checksum ".version_file" }}-{{ checksum "mix.lock" }}
26+
- run: mix dialyzer --plt
27+
- save_cache:
28+
key: plt-cache-{{ checksum ".version_file" }}-{{ checksum "mix.lock" }}
29+
paths:
30+
- _build
31+
- deps
32+
- ~/.mix
33+
dialyzer:
34+
docker:
35+
- image: circleci/elixir:1.9.4
36+
environment:
37+
MIX_ENV: test
38+
steps:
39+
- checkout
40+
- run: echo "$OTP_VERSION $ELIXIR_VERSION" > .version_file
41+
- restore_cache:
42+
keys:
43+
- plt-cache-{{ checksum ".version_file" }}-{{ checksum "mix.lock" }}
44+
- run:
45+
name: Execute dialyzer
46+
command: mix dialyzer --halt-exit-status
47+
test:
48+
docker:
49+
- image: circleci/elixir:1.9.4
50+
environment:
51+
MIX_ENV: test
52+
- image: circleci/postgres:10.1-alpine
53+
environment:
54+
POSTGRES_USER: postgres
55+
POSTGRES_DB: ez_coins_test
56+
POSTGRES_PASSWORD: postgres
57+
steps:
58+
- checkout
59+
- restore_cache:
60+
key: v1-deps-cache-{{ checksum "mix.lock" }}
61+
- run: mix test
62+
generate_documentation:
63+
docker:
64+
- image: circleci/elixir:1.9.4
65+
environment:
66+
MIX_ENV: test
67+
steps:
68+
- checkout
69+
- restore_cache:
70+
key: v1-deps-cache-{{ checksum "mix.lock" }}
71+
- run: mix docs
72+
- store_artifacts:
73+
path: doc
74+
destination: documentation
75+
format_check:
76+
docker:
77+
- image: circleci/elixir:1.9.4
78+
environment:
79+
MIX_ENV: test
80+
steps:
81+
- checkout
82+
- restore_cache:
83+
key: v1-deps-cache-{{ checksum "mix.lock" }}
84+
- run: mix format --check-formatted
85+
build_production:
486
docker:
587
- image: docker:17.05.0-ce-git
688
working_directory: /ez-coins-api
@@ -45,9 +127,24 @@ jobs:
45127
46128
workflows:
47129
version: 2
48-
build-and-deploy:
130+
checks:
131+
jobs:
132+
- build_test
133+
- format_check:
134+
requires:
135+
- build_test
136+
- generate_documentation:
137+
requires:
138+
- build_test
139+
- dialyzer:
140+
requires:
141+
- build_test
142+
- test:
143+
requires:
144+
- build_test
145+
deploy_production:
49146
jobs:
50-
- build:
147+
- build_production:
51148
filters:
52149
tags:
53150
only: /.*/
@@ -60,7 +157,7 @@ workflows:
60157
branches:
61158
ignore: /.*/
62159
requires:
63-
- build
160+
- build_production
64161
- deploy:
65162
filters:
66163
tags:

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# EzCoinsApi
22

3+
[![CircleCI](https://circleci.com/gh/maykonmichel/ezcoins-api.svg?style=svg)](https://circleci.com/gh/maykonmichel/ezcoins-api)
4+
35
To start your Phoenix server:
46

57
* Install dependencies with `mix deps.get`

lib/ez_coins_api_web/router.ex

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
defmodule EzCoinsApiWeb.Router do
22
use EzCoinsApiWeb, :router
3+
@dialyzer {:no_return, {:__checks__, 0}}
34

45
pipeline :api do
56
plug CORSPlug, origin: "*"

mix.exs

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ defmodule EzCoinsApi.MixProject do
1010
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
1111
start_permanent: Mix.env() == :prod,
1212
aliases: aliases(),
13-
deps: deps()
13+
deps: deps(),
14+
dialyzer: [
15+
list_unused_filters: true,
16+
plt_add_apps: [:ex_unit]
17+
]
1418
]
1519
end
1620

@@ -47,7 +51,9 @@ defmodule EzCoinsApi.MixProject do
4751
{:absinthe_plug, "~> 1.4"},
4852
{:absinthe_phoenix, "~> 1.4"},
4953
{:guardian, "~> 2.0"},
50-
{:cors_plug, "~> 2.0"}
54+
{:cors_plug, "~> 2.0"},
55+
{:dialyxir, "~> 1.0.0-rc.7", only: [:dev, :test], runtime: false},
56+
{:ex_doc, "~> 0.21.3", only: [:dev, :test], runtime: false}
5157
]
5258
end
5359

mix.lock

+7
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@
1212
"cowlib": {:hex, :cowlib, "2.8.0", "fd0ff1787db84ac415b8211573e9a30a3ebe71b5cbff7f720089972b2319c8a4", [:rebar3], [], "hexpm", "79f954a7021b302186a950a32869dbc185523d99d3e44ce430cd1f3289f41ed4"},
1313
"db_connection": {:hex, :db_connection, "2.2.1", "caee17725495f5129cb7faebde001dc4406796f12a62b8949f4ac69315080566", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "2b02ece62d9f983fcd40954e443b7d9e6589664380e5546b2b9b523cd0fb59e1"},
1414
"decimal": {:hex, :decimal, "1.8.1", "a4ef3f5f3428bdbc0d35374029ffcf4ede8533536fa79896dd450168d9acdf3c", [:mix], [], "hexpm", "3cb154b00225ac687f6cbd4acc4b7960027c757a5152b369923ead9ddbca7aec"},
15+
"dialyxir": {:hex, :dialyxir, "1.0.0-rc.7", "6287f8f2cb45df8584317a4be1075b8c9b8a69de8eeb82b4d9e6c761cf2664cd", [:mix], [{:erlex, ">= 0.2.5", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "506294d6c543e4e5282d4852aead19ace8a35bedeb043f9256a06a6336827122"},
16+
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
1517
"ecto": {:hex, :ecto, "3.3.3", "0830bf3aebcbf3d8c1a1811cd581773b6866886c012f52c0f027031fa96a0b53", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "12e368e3c2a2938d7776defaabdae40e82900fc4d8d66120ec1e01dfd8b93c3a"},
1618
"ecto_sql": {:hex, :ecto_sql, "3.3.4", "aa18af12eb875fbcda2f75e608b3bd534ebf020fc4f6448e4672fcdcbb081244", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.4 or ~> 3.3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5eccbdbf92e3c6f213007a82d5dbba4cd9bb659d1a21331f89f408e4c0efd7a8"},
1719
"elixir_make": {:hex, :elixir_make, "0.6.0", "38349f3e29aff4864352084fc736fa7fa0f2995a819a737554f7ebd28b85aaab", [:mix], [], "hexpm", "d522695b93b7f0b4c0fcb2dfe73a6b905b1c301226a5a55cb42e5b14d509e050"},
20+
"erlex": {:hex, :erlex, "0.2.5", "e51132f2f472e13d606d808f0574508eeea2030d487fc002b46ad97e738b0510", [:mix], [], "hexpm", "756d3e19b056339af674b715fdd752c5dac468cf9d0e2d1a03abf4574e99fbf8"},
21+
"ex_doc": {:hex, :ex_doc, "0.21.3", "857ec876b35a587c5d9148a2512e952e24c24345552259464b98bfbb883c7b42", [:mix], [{:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "0db1ee8d1547ab4877c5b5dffc6604ef9454e189928d5ba8967d4a58a801f161"},
1822
"gettext": {:hex, :gettext, "0.17.4", "f13088e1ec10ce01665cf25f5ff779e7df3f2dc71b37084976cf89d1aa124d5c", [:mix], [], "hexpm", "3c75b5ea8288e2ee7ea503ff9e30dfe4d07ad3c054576a6e60040e79a801e14d"},
1923
"guardian": {:hex, :guardian, "2.0.0", "5d3e537832b7cf35c8674da92457b7be671666a2eff4bf0f2ccfcfb3a8c67a0b", [:mix], [{:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "6804b9eea4a30cab82bf51f1ae7ae333980b3bdcc6535b018242c4737e41e042"},
2024
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fdf843bca858203ae1de16da2ee206f53416bbda5dc8c9e78f43243de4bc3afe"},
2125
"jose": {:hex, :jose, "1.9.0", "4167c5f6d06ffaebffd15cdb8da61a108445ef5e85ab8f5a7ad926fdf3ada154", [:mix, :rebar3], [{:base64url, "~> 0.0.1", [hex: :base64url, repo: "hexpm", optional: false]}], "hexpm", "6429c4fee52b2dda7861ee19a4f09c8c1ffa213bee3a1ec187828fde95d447ed"},
26+
"makeup": {:hex, :makeup, "1.0.0", "671df94cf5a594b739ce03b0d0316aa64312cee2574b6a44becb83cd90fb05dc", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "a10c6eb62cca416019663129699769f0c2ccf39428b3bb3c0cb38c718a0c186d"},
27+
"makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "d4b316c7222a85bbaa2fd7c6e90e37e953257ad196dc229505137c5e505e9eff"},
2228
"mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"},
29+
"nimble_parsec": {:hex, :nimble_parsec, "0.5.3", "def21c10a9ed70ce22754fdeea0810dafd53c2db3219a0cd54cf5526377af1c6", [:mix], [], "hexpm", "589b5af56f4afca65217a1f3eb3fee7e79b09c40c742fddc1c312b3ac0b3399f"},
2330
"phoenix": {:hex, :phoenix, "1.4.14", "daad685c40579393463ecb87896aa816cdec8ab6fddea2b142f44c24b2414e38", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d0495825477b9699a065d1f865d9f5d8711fa5ba09bf8b5b762b58549efc00fa"},
2431
"phoenix_ecto": {:hex, :phoenix_ecto, "4.1.0", "a044d0756d0464c5a541b4a0bf4bcaf89bffcaf92468862408290682c73ae50d", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.9", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "c5e666a341ff104d0399d8f0e4ff094559b2fde13a5985d4cb5023b2c2ac558b"},
2532
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm", "1f13f9f0f3e769a667a6b6828d29dec37497a082d195cc52dbef401a9b69bf38"},

test/ez_coins_api_web/user_resolver_test.exs

+2-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ defmodule EzCoinsApiWeb.UserResolverTest do
188188
"errors" => [
189189
%{
190190
"details" => details
191-
} | _
191+
}
192+
| _
192193
]
193194
} =
194195
admin_conn

0 commit comments

Comments
 (0)