PR Feedback implementation (#24) #48
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
name: build | |
on: | |
push: | |
branches: | |
- "*" | |
tags-ignore: | |
- "*" | |
jobs: | |
install: | |
name: Install deps and generate PLT's | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: "1.16.1" | |
otp-version: "26.2.1" | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
priv/plts | |
key: ${{ runner.os }}-mix-erlef-${{ hashFiles('mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix-erlef- | |
- name: Install Dependencies | |
if: steps.mix-cache.outputs.cache-hit != 'true' | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
mix deps.compile | |
mix dialyzer --plt | |
static_code_analysis: | |
name: Static Code Analysis | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: "1.16.1" | |
otp-version: "26.2.1" | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
deps | |
_build | |
priv/plts | |
key: ${{ runner.os }}-mix-erlef-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix-erlef- | |
- name: Check formatted | |
run: make format | |
- name: Run credo | |
run: make credo | |
- name: Run dialyzer | |
run: make dialyzer | |
unit_test: | |
name: Unit Test | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: "1.16.1" | |
otp-version: "26.2.1" | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
deps | |
_build | |
priv/plts | |
key: ${{ runner.os }}-mix-erlef-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix-erlef- | |
- name: Run tests | |
env: | |
MIX_ENV: test | |
run: make test |