-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from peek-travel/otp24-updates
Updates for OTP 24.0
- Loading branch information
Showing
12 changed files
with
263 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: mix | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "13:00" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ on: push | |
|
||
env: | ||
MIX_ENV: test | ||
OTP_VERSION_SPEC: "24.0" | ||
ELIXIR_VERSION_SPEC: "1.12.0" | ||
|
||
jobs: | ||
compile: | ||
|
@@ -12,30 +14,40 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# shared steps | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
- uses: erlef/setup-elixir@v1 | ||
id: setup | ||
with: | ||
otp-version: 22.x | ||
elixir-version: 1.9.x | ||
- uses: actions/cache@v1 | ||
id: cache-mix | ||
otp-version: ${{ env.OTP_VERSION_SPEC }} | ||
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }} | ||
- name: Cache Keys | ||
id: keys | ||
run: | | ||
echo ::set-output name=deps_key::deps-${{ runner.os }} | ||
echo ::set-output name=lockfile_key::${{ hashFiles('mix.lock') }} | ||
echo ::set-output name=build_key::build-${{ runner.os }}-${{ env.MIX_ENV }} | ||
echo ::set-output name=version_key::${{ steps.setup.outputs['otp-version'] }}-${{ steps.setup.outputs['elixir-version'] }} | ||
echo ::set-output name=files_key::${{ hashFiles('apps/*/lib/**/*.ex','apps/*/test/**/*.ex','mix.lock') }} | ||
- uses: actions/[email protected] | ||
id: deps_cache | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }} | ||
key: ${{ steps.keys.outputs.deps_key }}-${{ steps.keys.outputs.lockfile_key }} | ||
restore-keys: | | ||
${{ runner.os }}-mix-v5- | ||
- uses: actions/cache@v1 | ||
id: cache-build | ||
${{ steps.keys.outputs.deps_key }}- | ||
- uses: actions/cache@v2.1.3 | ||
id: build_cache | ||
with: | ||
path: _build | ||
key: ${{ runner.os }}-build-v3-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }} | ||
key: ${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}-${{ steps.keys.outputs.files_key }} | ||
restore-keys: | | ||
${{ runner.os }}-build-v3- | ||
${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}- | ||
- name: Install dependencies | ||
if: steps.cache-mix.outputs.cache-hit != 'true' | ||
if: steps.deps_cache.outputs['cache-hit'] != 'true' | ||
run: mix deps.get | ||
- name: Compile | ||
if: steps.cache-build.outputs.cache-hit != 'true' | ||
if: steps.build_cache.outputs['cache-hit'] != 'true' | ||
run: mix compile --warnings-as-errors | ||
|
||
format: | ||
|
@@ -46,15 +58,42 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# shared steps | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
- uses: erlef/setup-elixir@v1 | ||
id: setup | ||
with: | ||
otp-version: 22.x | ||
elixir-version: 1.9.x | ||
- uses: actions/cache@v1 | ||
otp-version: ${{ env.OTP_VERSION_SPEC }} | ||
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }} | ||
- name: Cache Keys | ||
id: keys | ||
run: | | ||
echo ::set-output name=deps_key::deps-${{ runner.os }} | ||
echo ::set-output name=lockfile_key::${{ hashFiles('mix.lock') }} | ||
echo ::set-output name=build_key::build-${{ runner.os }}-${{ env.MIX_ENV }} | ||
echo ::set-output name=version_key::${{ steps.setup.outputs['otp-version'] }}-${{ steps.setup.outputs['elixir-version'] }} | ||
echo ::set-output name=files_key::${{ hashFiles('apps/*/lib/**/*.ex','apps/*/test/**/*.ex','mix.lock') }} | ||
- uses: actions/[email protected] | ||
id: deps_cache | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }} | ||
key: ${{ steps.keys.outputs.deps_key }}-${{ steps.keys.outputs.lockfile_key }} | ||
restore-keys: | | ||
${{ steps.keys.outputs.deps_key }}- | ||
- uses: actions/[email protected] | ||
id: build_cache | ||
with: | ||
path: _build | ||
key: ${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}-${{ steps.keys.outputs.files_key }} | ||
restore-keys: | | ||
${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}- | ||
- name: Install dependencies | ||
if: steps.deps_cache.outputs['cache-hit'] != 'true' | ||
run: mix deps.get | ||
- name: Compile | ||
if: steps.build_cache.outputs['cache-hit'] != 'true' | ||
run: mix compile --warnings-as-errors | ||
# job steps | ||
- name: Check formatted | ||
run: mix format --check-formatted | ||
|
||
|
@@ -66,19 +105,39 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# shared steps | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
- uses: erlef/setup-elixir@v1 | ||
id: setup | ||
with: | ||
otp-version: 22.x | ||
elixir-version: 1.9.x | ||
- uses: actions/cache@v1 | ||
otp-version: ${{ env.OTP_VERSION_SPEC }} | ||
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }} | ||
- name: Cache Keys | ||
id: keys | ||
run: | | ||
echo ::set-output name=deps_key::deps-${{ runner.os }} | ||
echo ::set-output name=lockfile_key::${{ hashFiles('mix.lock') }} | ||
echo ::set-output name=build_key::build-${{ runner.os }}-${{ env.MIX_ENV }} | ||
echo ::set-output name=version_key::${{ steps.setup.outputs['otp-version'] }}-${{ steps.setup.outputs['elixir-version'] }} | ||
echo ::set-output name=files_key::${{ hashFiles('apps/*/lib/**/*.ex','apps/*/test/**/*.ex','mix.lock') }} | ||
- uses: actions/[email protected] | ||
id: deps_cache | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }} | ||
- uses: actions/cache@v1 | ||
key: ${{ steps.keys.outputs.deps_key }}-${{ steps.keys.outputs.lockfile_key }} | ||
restore-keys: | | ||
${{ steps.keys.outputs.deps_key }}- | ||
- uses: actions/[email protected] | ||
id: build_cache | ||
with: | ||
path: _build | ||
key: ${{ runner.os }}-build-v3-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }} | ||
key: ${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}-${{ steps.keys.outputs.files_key }} | ||
restore-keys: | | ||
${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}- | ||
- name: Compile | ||
if: steps.build_cache.outputs['cache-hit'] != 'true' | ||
run: mix compile --warnings-as-errors | ||
# job steps | ||
- name: Run tests | ||
run: mix coveralls.json | ||
- uses: codecov/codecov-action@v1 | ||
|
@@ -94,19 +153,39 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# shared steps | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
- uses: erlef/setup-elixir@v1 | ||
id: setup | ||
with: | ||
otp-version: 22.x | ||
elixir-version: 1.9.x | ||
- uses: actions/cache@v1 | ||
otp-version: ${{ env.OTP_VERSION_SPEC }} | ||
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }} | ||
- name: Cache Keys | ||
id: keys | ||
run: | | ||
echo ::set-output name=deps_key::deps-${{ runner.os }} | ||
echo ::set-output name=lockfile_key::${{ hashFiles('mix.lock') }} | ||
echo ::set-output name=build_key::build-${{ runner.os }}-${{ env.MIX_ENV }} | ||
echo ::set-output name=version_key::${{ steps.setup.outputs['otp-version'] }}-${{ steps.setup.outputs['elixir-version'] }} | ||
echo ::set-output name=files_key::${{ hashFiles('apps/*/lib/**/*.ex','apps/*/test/**/*.ex','mix.lock') }} | ||
- uses: actions/[email protected] | ||
id: deps_cache | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }} | ||
- uses: actions/cache@v1 | ||
key: ${{ steps.keys.outputs.deps_key }}-${{ steps.keys.outputs.lockfile_key }} | ||
restore-keys: | | ||
${{ steps.keys.outputs.deps_key }}- | ||
- uses: actions/[email protected] | ||
id: build_cache | ||
with: | ||
path: _build | ||
key: ${{ runner.os }}-build-v3-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }} | ||
key: ${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}-${{ steps.keys.outputs.files_key }} | ||
restore-keys: | | ||
${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}- | ||
- name: Compile | ||
if: steps.build_cache.outputs['cache-hit'] != 'true' | ||
run: mix compile --warnings-as-errors | ||
# job steps | ||
- name: Run credo | ||
run: mix credo --strict | ||
|
||
|
@@ -117,30 +196,51 @@ jobs: | |
|
||
env: | ||
MIX_ENV: dev | ||
# Change either of these if you want to bust the cache: | ||
DEPS_CACHE_PREFIX: dialyzer-v2- | ||
BUILD_CACHE_PREFIX: dialyzer-v2- | ||
|
||
steps: | ||
# shared steps | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
- uses: erlef/setup-elixir@v1 | ||
id: setup | ||
with: | ||
otp-version: 22.x | ||
elixir-version: 1.9.x | ||
- uses: actions/cache@v1 | ||
id: cache-build-dev | ||
otp-version: ${{ env.OTP_VERSION_SPEC }} | ||
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }} | ||
- name: Cache Keys | ||
id: keys | ||
run: | | ||
echo ::set-output name=deps_key::deps-${{ runner.os }} | ||
echo ::set-output name=lockfile_key::${{ hashFiles('mix.lock') }} | ||
echo ::set-output name=build_key::build-${{ runner.os }}-${{ env.MIX_ENV }} | ||
echo ::set-output name=version_key::${{ steps.setup.outputs['otp-version'] }}-${{ steps.setup.outputs['elixir-version'] }} | ||
echo ::set-output name=files_key::${{ hashFiles('apps/*/lib/**/*.ex','apps/*/test/**/*.ex','mix.lock') }} | ||
echo ::set-output name=deps_cache_prefix::${{ env.DEPS_CACHE_PREFIX }} | ||
echo ::set-output name=build_cache_prefix::${{ env.BUILD_CACHE_PREFIX }} | ||
- uses: actions/[email protected] | ||
id: deps_cache | ||
with: | ||
path: _build | ||
key: ${{ runner.os }}-build-dev-v3-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }} | ||
path: deps | ||
key: ${{ steps.keys.outputs.deps_cache_prefix }}${{ steps.keys.outputs.deps_key }}-${{ steps.keys.outputs.lockfile_key }} | ||
restore-keys: | | ||
${{ runner.os }}-build-dev-v3- | ||
- uses: actions/cache@v1 | ||
${{ steps.keys.outputs.deps_cache_prefix }}${{ steps.keys.outputs.deps_key }}- | ||
- uses: actions/[email protected] | ||
id: build_cache | ||
with: | ||
path: plts | ||
key: ${{ runner.os }}-plts-v3-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }} | ||
path: _build | ||
key: ${{ steps.keys.outputs.build_cache_prefix }}${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}-${{ steps.keys.outputs.files_key }} | ||
restore-keys: | | ||
${{ runner.os }}-plts-v3- | ||
${{ steps.keys.outputs.build_cache_prefix }}${{ steps.keys.outputs.build_key }}-${{ steps.keys.outputs.version_key }}- | ||
- name: Install dependencies | ||
if: steps.deps_cache.outputs['cache-hit'] != 'true' | ||
run: mix deps.get | ||
- name: Compile | ||
if: steps.cache-build-dev.outputs.cache-hit != 'true' | ||
run: mix compile | ||
if: steps.build_cache.outputs['cache-hit'] != 'true' | ||
run: mix compile --warnings-as-errors | ||
# job steps | ||
- name: PLTs | ||
if: steps.build_cache.outputs['cache-hit'] != 'true' | ||
run: mix dialyzer --plt --no-compile | ||
- name: Run dialyzer | ||
run: mix dialyzer | ||
run: mix dialyzer --no-check --no-compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
elixir 1.10.3-otp-22 | ||
erlang 22.3.4.1 | ||
elixir 1.12.0-otp-24 | ||
erlang 24.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,13 @@ defmodule Tipalti.API.Payer do | |
iex> too_long_description = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | ||
iex> create_or_update_invoices([%{idap: "somepayee", ref_code: "testinvoice3", due_date: "2018-05-01", date: "2018-06-01", description: too_long_description, currency: "USD", line_items: [%{amount: "100.00", description: "test line item"}]}]) | ||
{:error, %Tipalti.ClientError{error_code: "UnknownError", error_message: "Internal server errror"}} | ||
iex> custom_fields = [%{key: "foo", value: "bar"}] | ||
...> line_items = [%{amount: "100.00", description: "test line item", custom_fields: custom_fields}] | ||
...> approvers = [%{name: "Mr. Approver", email: "[email protected]", order: 1}] | ||
...> invoice = %{idap: "somepayee", ref_code: "testinvoice", due_date: "2018-06-01", date: "2018-05-01", subject: "test invoice", currency: "USD", line_items: line_items, custom_fields: custom_fields, approvers: approvers} | ||
...> create_or_update_invoices([invoice]) | ||
{:ok, [%{error_message: nil, ref_code: "testinvoice", succeeded: true}]} | ||
""" | ||
@spec create_or_update_invoices([invoice()]) :: | ||
{:ok, [%{error_message: String.t() | nil, ref_code: String.t(), succeeded: boolean()}]} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.