Skip to content

Commit

Permalink
refactor gh build (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaxa authored Jan 20, 2022
1 parent 4291bc6 commit f05dbac
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 43 deletions.
23 changes: 2 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Artifact
name: Maven Build Artifact

on:
pull_request:
Expand All @@ -7,23 +7,4 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Install thrift
uses: valitydev/action-setup-thrift@v0.0.1
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Maven
uses: actions/setup-java@v2
with:
java-version: '15'
distribution: 'adopt'
- name: Retrieve commit info
run: |
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
id: commit_info
- name: Build package
run: mvn --batch-mode -Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}" clean compile -f pom.xml
uses: valitydev/base-workflow/.github/workflows/maven-thrift-build.yml@v1.0.0
29 changes: 7 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Artifact
name: Maven Deploy Artifact

on:
push:
Expand All @@ -8,24 +8,9 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: Install thrift
uses: valitydev/action-setup-thrift@v0.0.1
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Retrieve commit info
run: |
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
id: commit_info
- name: Deploy package
uses: valitydev/action-deploy-jdk-package@v1.0.12
with:
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
deploy-secret-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
maven-args: '-Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}"'
uses: valitydev/base-workflow/.github/workflows/maven-thrift-deploy.yml@v1.0.0
with:
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
deploy-secret-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
10 changes: 10 additions & 0 deletions .github/workflows/erlang-build-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Erlang Build And Verify

on:
pull_request:
branches:
- '*'

jobs:
build:
uses: valitydev/base-workflow/.github/workflows/erlang-thrift-build.yml@v1.0.0
69 changes: 69 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
%% Common project erlang options.
{erl_opts, [

% mandatory
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,

% at will
% bin_opt_info
% no_auto_import,
warn_missing_spec_all
]}.

%% XRef checks
{xref_checks, [
undefined_function_calls,
undefined_functions,
deprecated_functions_calls,
deprecated_functions
]}.

%% Tests
{cover_enabled, true}.

%% Dialyzer static analyzing
{dialyzer, [
{warnings, [
% mandatory
unmatched_returns,
error_handling,
race_conditions,
unknown
]},
{plt_apps, all_deps}
]}.

{deps, []}.

{plugins, [
{rebar3_thrift_compiler,
{git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.3.1"}}}
]}.

{provider_hooks, [
{pre, [
{compile, {thrift, compile}},
{clean , {thrift, clean }}
]}
]}.

{thrift_compiler_opts, [
{in_dir, "proto"},
{in_files, all},
{gen, "erlang:scoped_typenames"}
]}.
1 change: 1 addition & 0 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[].

0 comments on commit f05dbac

Please sign in to comment.