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
|
2021-12-08 16:57:15 +03:00
|
|
|
runs-on: buildjet-4vcpu-ubuntu-2004
|
2020-12-29 16:17:27 +03:00
|
|
|
|
2022-10-05 11:01:41 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
postgres_version: [12,13,14]
|
|
|
|
|
2020-12-29 16:17:27 +03:00
|
|
|
services:
|
|
|
|
postgres:
|
2022-10-05 11:01:41 +03:00
|
|
|
image: postgres:${{ matrix.postgres_version }}
|
2020-12-29 16:17:27 +03:00
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
|
|
|
|
clickhouse:
|
2021-11-16 11:45:21 +03:00
|
|
|
image: yandex/clickhouse-server:21.11
|
2020-12-29 16:17:27 +03:00
|
|
|
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
|
2022-06-06 10:42:24 +03:00
|
|
|
uses: erlef/setup-beam@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
|
2022-09-21 13:41:03 +03:00
|
|
|
key: ${{ runner.os }}-mix-v2-${{ hashFiles('**/mix.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-mix-v2-
|
2021-01-07 16:16:04 +03:00
|
|
|
- name: Install dependencies
|
2022-10-11 13:19:28 +03:00
|
|
|
run: mix deps.get && npm install --prefix ./tracker
|
2021-01-07 16:16:04 +03:00
|
|
|
- name: Check Formatting
|
|
|
|
run: mix format --check-formatted
|
|
|
|
- name: Check Compile Warnings
|
|
|
|
run: mix compile --warnings-as-errors --all-warnings
|
2022-10-11 13:19:28 +03:00
|
|
|
- name: Generate tracker files
|
|
|
|
run: npm run deploy --prefix ./tracker
|
2021-01-07 16:16:04 +03:00
|
|
|
- name: Run tests
|
|
|
|
run: mix test
|
2021-08-19 13:23:44 +03:00
|
|
|
#- name: Check Dialyzer
|
|
|
|
# run: mix dialyzer <-- false negatives
|
2021-01-07 16:16:04 +03:00
|
|
|
- name: Check Credo Warnings
|
|
|
|
run: mix credo --strict --only warning --ignore Consistency
|
2020-12-29 16:17:27 +03:00
|
|
|
env:
|
|
|
|
MIX_ENV: test
|