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:
|
2022-12-26 16:20:29 +03:00
|
|
|
postgres_version: [12, 13, 14]
|
2022-10-05 11:01:41 +03:00
|
|
|
|
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:
|
2023-02-09 10:11:03 +03:00
|
|
|
image: clickhouse/clickhouse-server:22.8.13.20-alpine
|
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:
|
2022-11-05 05:42:03 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-01-07 16:16:04 +03:00
|
|
|
- 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
|
2023-05-11 15:08:39 +03:00
|
|
|
uses: actions/cache@v3
|
2021-01-07 16:16:04 +03:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
deps
|
|
|
|
_build
|
|
|
|
priv/plts
|
2023-05-09 11:51:35 +03:00
|
|
|
key: ${{ runner.os }}-mix-v4-${{ hashFiles('**/mix.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-mix-v4-
|
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
|
2022-11-05 05:42:03 +03:00
|
|
|
- name: Check Credo Warnings
|
|
|
|
run: mix credo diff --from-git-merge-base origin/master
|
2023-04-21 10:33:57 +03:00
|
|
|
- name: Run tests
|
2023-03-15 15:13:46 +03:00
|
|
|
run: mix test --include slow --max-failures 1 --warnings-as-errors
|
2022-11-05 05:42:03 +03:00
|
|
|
- name: Check Dialyzer
|
|
|
|
run: mix dialyzer
|
2020-12-29 16:17:27 +03:00
|
|
|
env:
|
|
|
|
MIX_ENV: test
|