Add consmetic updates to admin ui #24
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
prepare: | |
name: Prepare | |
runs-on: ubuntu-latest | |
if: "! contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- run: echo "${{ github.event.head_commit.message }}" | |
build-and-compile: | |
name: Build & Compile | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.14.4' | |
otp-version: '26.0' | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Restore build cache | |
uses: actions/cache@v2 | |
with: | |
path: _build/ | |
key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-build- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Compilation | |
run: mix compile --all-warnings --warnings-as-errors | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: prepare | |
services: | |
db: | |
image: postgres:13 | |
ports: ['5432:5432'] | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
MIX_ENV: test | |
HEIMDALL_DB_USERNAME: postgres | |
HEIMDALL_DB_PASSWORD: postgres | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.14.4' | |
otp-version: '26.0' | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Restore build cache | |
uses: actions/cache@v2 | |
with: | |
path: _build/ | |
key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-build- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Test ${{ matrix.test_number }} | |
run: mix coveralls | |
check_formatted: | |
name: Check Formatted | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.14.4' | |
otp-version: '26.0' | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Restore build cache | |
uses: actions/cache@v2 | |
with: | |
path: _build/ | |
key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-build- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Check Formatted | |
run: mix format --check-formatted | |
credo: | |
name: Mix Credo | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.14.4' | |
otp-version: '26.0' | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Restore build cache | |
uses: actions/cache@v2 | |
with: | |
path: _build/ | |
key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-build- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Run Credo Strict | |
run: mix credo --strict | |
dialyzer: | |
name: Mix Dialyzer | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.14.4' | |
otp-version: '26.0' | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Restore build cache | |
uses: actions/cache@v2 | |
with: | |
path: _build/ | |
key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-build- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Restore PLT Cache | |
uses: actions/cache@v1 | |
id: plt-cache | |
with: | |
path: priv/plts | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Cache PLT if not exist | |
if: steps.plt-cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p priv/plts | |
mix dialyzer --plt | |
- name: Run Dialyzer | |
run: mix dialyzer |