diff --git a/.github/workflows/erlang-pr.yml b/.github/workflows/erlang-pr.yml new file mode 100644 index 0000000..32cd36a --- /dev/null +++ b/.github/workflows/erlang-pr.yml @@ -0,0 +1,21 @@ +name: Erlang CI Checks + +on: + push: + branches: + - 'master' + - 'epic/**' + pull_request: + branches: ['**'] + +jobs: + run: + name: Run checks + uses: valitydev/erlang-workflows/.github/workflows/erlang-simple-build.yml@v1 + with: + otp-version: 24 + rebar-version: 3.18 + thrift-version: 0.14.2.3 + use-thrift: true + run-eunit: false + run-common-test: false diff --git a/proto/fraudbusters.thrift b/proto/fraudbusters.thrift index 816ddb2..034641b 100644 --- a/proto/fraudbusters.thrift +++ b/proto/fraudbusters.thrift @@ -6,7 +6,7 @@ include 'domain.thrift' */ namespace java dev.vality.damsel.fraudbusters -namespace erlang fraudbusters +namespace erlang fb_proto.fraudbusters typedef string ID typedef ID AccountID diff --git a/rebar.config b/rebar.config new file mode 100644 index 0000000..531bfc8 --- /dev/null +++ b/rebar.config @@ -0,0 +1,54 @@ +%% Common project erlang options. +{erl_opts, [ + debug_info, + warnings_as_errors, + warn_export_all, + warn_missing_spec, + warn_untyped_record, + warn_export_vars, + + % by default + warn_unused_record, + warn_bif_clash, + warn_obsolete_guard, + warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_unused_function, + warn_deprecated_function, + warn_missing_spec_all +]}. + +{deps, [ + {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "master"}}} +]}. + +{xref_checks, [ + undefined_function_calls, + undefined_functions, + deprecated_functions_calls, + deprecated_functions +]}. + +{dialyzer, [ + {warnings, [unmatched_returns, error_handling, unknown]}, + {plt_apps, all_deps} +]}. + +{plugins, [ + {rebar3_thrift_compiler, + {git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.4"}}} +]}. + +{provider_hooks, [ + {pre, [ + {compile, {thrift, compile}}, + {clean, {thrift, clean}} + ]} +]}. + +{thrift_compiler_opts, [ + {in_dir, "proto"}, + {include_dirs, ["_build/default/lib/damsel/proto"]}, + {gen, "erlang:app_namespaces"} +]}. diff --git a/rebar.lock b/rebar.lock new file mode 100644 index 0000000..ed13784 --- /dev/null +++ b/rebar.lock @@ -0,0 +1,4 @@ +[{<<"damsel">>, + {git,"https://github.com/valitydev/damsel.git", + {ref,"5c25c2e8f27366ca591fc50787dedabe8448945c"}}, + 0}]. diff --git a/src/fraudbusters_proto.app.src b/src/fraudbusters_proto.app.src new file mode 100644 index 0000000..1ddc531 --- /dev/null +++ b/src/fraudbusters_proto.app.src @@ -0,0 +1,11 @@ +{application, fraudbusters_proto, [ + {description, "Fraudbusters thrift protocol"}, + {vsn, "0.1.0"}, + {registered, []}, + {applications, [ + kernel, + stdlib, + damsel + ]}, + {env, []} +]}.