2020-12-29 16:17:27 +03:00
|
|
|
name: Elixir CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-01-07 16:16:04 +03:00
|
|
|
branches: [master, stable]
|
2020-12-29 16:17:27 +03:00
|
|
|
pull_request:
|
2021-01-07 16:16:04 +03:00
|
|
|
branches: [master, stable]
|
2020-12-29 16:17:27 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:12
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
|
|
|
|
clickhouse:
|
|
|
|
image: yandex/clickhouse-server:20
|
|
|
|
ports:
|
|
|
|
- 8123:8123
|
|
|
|
env:
|
|
|
|
options: >-
|
|
|
|
--health-cmd nc -zw3 localhost 8124
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
|
|
|
|
steps:
|
2021-01-07 16:16:04 +03:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Read .tool-versions
|
|
|
|
uses: marocchino/tool-versions-action@v1
|
|
|
|
id: versions
|
|
|
|
- name: Set up Elixir
|
2021-03-10 15:41:17 +03:00
|
|
|
uses: erlef/setup-elixir@v1
|
2021-01-07 16:16:04 +03:00
|
|
|
with:
|
|
|
|
elixir-version: ${{steps.versions.outputs.elixir}}
|
|
|
|
otp-version: ${{ steps.versions.outputs.erlang}}
|
|
|
|
- name: Restore dependencies cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
deps
|
|
|
|
_build
|
|
|
|
priv/plts
|
|
|
|
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-mix-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Check Formatting
|
|
|
|
run: mix format --check-formatted
|
|
|
|
- name: Check Compile Warnings
|
|
|
|
run: mix compile --warnings-as-errors --all-warnings
|
|
|
|
- name: Run tests
|
|
|
|
run: mix test
|
|
|
|
- name: Check Dialyzer
|
|
|
|
run: mix dialyzer
|
|
|
|
- name: Check Credo Warnings
|
|
|
|
run: mix credo --strict --only warning --ignore Consistency
|
2020-12-29 16:17:27 +03:00
|
|
|
env:
|
|
|
|
MIX_ENV: test
|