diff --git a/.github/workflows/erlang-pr.yml b/.github/workflows/erlang-pr.yml index 21b6b9c..ba70b5c 100644 --- a/.github/workflows/erlang-pr.yml +++ b/.github/workflows/erlang-pr.yml @@ -1,37 +1,17 @@ -name: Erlang +name: Erlang build + on: pull_request: - branches: ['*'] - push: - branches: [master] + branches: + - "*" jobs: build: - name: Build and verify - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v3 - - - uses: valitydev/action-setup-thrift@v1 - with: - thrift-version: '0.14.2.2' - - - uses: erlef/setup-beam@v1.9 - id: beam - with: - otp-version: '24' - rebar3-version: '3.18' - - - name: Restore PLT cache - uses: actions/cache@v3 - id: plt-cache - with: - key: | - ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-plt - path: | - _build/default/rebar3_*_plt - - - run: rebar3 compile - - run: rebar3 xref - - run: rebar3 dialyzer + uses: valitydev/erlang-workflows/.github/workflows/erlang-simple-build.yml@v1 + with: + otp-version: 24 + rebar-version: 3 + use-thrift: true + thrift-version: 0.14.2.3 + run-eunit: false + run-common-test: false diff --git a/proto/configurator.thrift b/proto/configurator.thrift index ecaa963..bc1a82c 100644 --- a/proto/configurator.thrift +++ b/proto/configurator.thrift @@ -3,7 +3,7 @@ include "limiter.thrift" include "limiter_config.thrift" namespace java dev.vality.limiter.configurator -namespace erlang limiter.configurator +namespace erlang limproto.configurator typedef string LimitName typedef limiter_config.LimitConfigID LimitConfigID diff --git a/proto/limiter.thrift b/proto/limiter.thrift index cd6d451..54c2abc 100644 --- a/proto/limiter.thrift +++ b/proto/limiter.thrift @@ -4,7 +4,7 @@ include "limiter_base.thrift" include "limiter_context.thrift" namespace java dev.vality.limiter -namespace erlang limiter +namespace erlang limproto.limiter typedef string LimitChangeID typedef string LimitID diff --git a/proto/limiter_base.thrift b/proto/limiter_base.thrift index 4d5c7d9..a56c77c 100644 --- a/proto/limiter_base.thrift +++ b/proto/limiter_base.thrift @@ -1,7 +1,7 @@ include "proto/domain.thrift" namespace java dev.vality.limiter.base -namespace erlang limiter.base +namespace erlang limproto.base struct AmountRange { 1: required AmountBound upper diff --git a/proto/limiter_config.thrift b/proto/limiter_config.thrift index 9d1bea2..8c9194c 100644 --- a/proto/limiter_config.thrift +++ b/proto/limiter_config.thrift @@ -3,7 +3,7 @@ */ namespace java dev.vality.limiter.config -namespace erlang limiter.config +namespace erlang limproto.config include "proto/base.thrift" include "proto/domain.thrift" diff --git a/proto/limiter_context.thrift b/proto/limiter_context.thrift index 83a6a1b..c7792b4 100644 --- a/proto/limiter_context.thrift +++ b/proto/limiter_context.thrift @@ -3,7 +3,7 @@ include "proto/domain.thrift" include "limiter_payproc_context.thrift" namespace java dev.vality.limiter.context -namespace erlang limiter.context +namespace erlang limproto.context.limiter typedef base.ID ID diff --git a/proto/limiter_payproc_context.thrift b/proto/limiter_payproc_context.thrift index 587f1c7..87c339f 100644 --- a/proto/limiter_payproc_context.thrift +++ b/proto/limiter_payproc_context.thrift @@ -2,7 +2,7 @@ include "proto/base.thrift" include "proto/domain.thrift" namespace java dev.vality.limiter.payproc.context -namespace erlang limiter.context.payproc +namespace erlang limproto.context.payproc /** * Контекст, получаемый из сервисов, реализующих один из интерфейсов протокола diff --git a/proto/limiter_range.thrift b/proto/limiter_range.thrift index ceae37c..ad11eac 100644 --- a/proto/limiter_range.thrift +++ b/proto/limiter_range.thrift @@ -3,7 +3,7 @@ */ namespace java dev.vality.limiter.range -namespace erlang limiter.range +namespace erlang limproto.range include "proto/base.thrift" include "proto/domain.thrift" diff --git a/proto/time_range.thrift b/proto/time_range.thrift index ff48c50..d3341c0 100644 --- a/proto/time_range.thrift +++ b/proto/time_range.thrift @@ -3,7 +3,7 @@ */ namespace java dev.vality.limiter.range.time -namespace erlang limiter.time.range +namespace erlang limproto.timerange include "proto/base.thrift" include "proto/domain.thrift" diff --git a/rebar.config b/rebar.config index 1ff06ee..8cac37b 100644 --- a/rebar.config +++ b/rebar.config @@ -1,6 +1,5 @@ %% Common project erlang options. {erl_opts, [ - % mandatory debug_info, warnings_as_errors, @@ -26,9 +25,7 @@ ]}. {deps, [ - {damsel, - {git, "https://github.com/valitydev/damsel.git", {branch, "master"}} - } + {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "master"}}} ]}. %% XRef checks @@ -52,18 +49,17 @@ {plugins, [ {rebar3_thrift_compiler, - {git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {branch, "master"}}} + {git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.4"}}} ]}. {provider_hooks, [ {pre, [ {compile, {thrift, compile}}, - {clean , {thrift, clean }} + {clean, {thrift, clean}} ]} ]}. {thrift_compiler_opts, [ {in_dir, "proto"}, - {in_files, all}, - {gen, "erlang:scoped_typenames,app_prefix=lim"} + {gen, "erlang:app_namespaces"} ]}. diff --git a/rebar.lock b/rebar.lock index a9fddfc..5d15125 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,4 +1,4 @@ [{<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"d384c125d16c0204e23b0d96a6ef791244a72315"}}, + {ref,"dac2cb599499cc0701e60856f4092c9ab283eedf"}}, 0}]. diff --git a/src/limiter_proto.app.src b/src/limiter_proto.app.src index e5b0fa6..46aa818 100644 --- a/src/limiter_proto.app.src +++ b/src/limiter_proto.app.src @@ -3,6 +3,7 @@ {vsn, "1.0.0"}, {applications, [ kernel, - stdlib + stdlib, + damsel ]} ]}.