Skip to content

Removed get_field_as_decimal helper, added credits for from_struct he… #6

Removed get_field_as_decimal helper, added credits for from_struct he…

Removed get_field_as_decimal helper, added credits for from_struct he… #6

Workflow file for this run

name: Test and build
on:
push:
branches: ["main"]
jobs:
test:
name: "Run tests"
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
- uses: actions/[email protected]
- name: Read .tool-versions
uses: marocchino/[email protected]
id: versions
- name: Set up Elixir ${{steps.versions.outputs.elixir}}
uses: erlef/setup-beam@v1
with:
elixir-version: ${{steps.versions.outputs.elixir}}
otp-version: ${{steps.versions.outputs.erlang}}
- name: Restore dependencies cache
uses: actions/[email protected]
with:
path: |
deps
_build
key: ${{ runner.os }}-mixv2-${{ hashFiles('**/mix.lock', 'config/*.exs') }}
restore-keys: ${{ runner.os }}-mixv2-
- name: Setup deps
run: |
mix deps.get
mix deps.unlock --check-unused
- name: Compile
run: mix compile --warnings-as-errors
- name: Check formatter
run: mix format --check-formatted
- name: Run tests
run: mix test --warnings-as-errors
- name: Cleanup
run: mix clean
dialyzer:
name: "Run Dialyzer"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Read .tool-versions
uses: marocchino/[email protected]
id: versions
- name: Set up Elixir ${{steps.versions.outputs.elixir}}
uses: erlef/setup-beam@v1
with:
elixir-version: ${{steps.versions.outputs.elixir}}
otp-version: ${{steps.versions.outputs.erlang}}
# Step: Define how to cache deps. Restores existing cache if present.
- name: Cache deps
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-elixir-deps
with:
path: deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
# Step: Define how to cache the `_build` directory. After the first run,
# this speeds up tests runs a lot. This includes not re-compiling our
# project's downloaded deps every run.
- name: Cache compiled build
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-compiled-build
with:
path: _build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v3
with:
key: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
path: |
priv/plts
- name: Setup deps
run: |
mix deps.get
mix deps.unlock --check-unused
- name: Compile
run: mix compile --warnings-as-errors
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@v3
if: steps.plt_cache.outputs.cache-hit != 'true'
with:
key: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
path: |
priv/plts
- name: Run dialyzer
run: mix dialyzer --format github
- name: Cleanup
run: mix clean