Skip to content

TBS-2755: Improve ETCD timeout handling (#9) #18

TBS-2755: Improve ETCD timeout handling (#9)

TBS-2755: Improve ETCD timeout handling (#9) #18

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
- ci
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.erlang }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- erlang: "25.2"
elixir: "1.14"
lint: true
coverage: true
dialyzer: true
- erlang: "24.3"
elixir: "1.12"
- erlang: "23.3.1"
elixir: "1.11"
dialyzer: true
- erlang: "21.3"
elixir: "1.10"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIX_ENV: test
steps:
- name: Checkout this repository
uses: actions/checkout@v3
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
- name: Install and compile dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: mix do deps.get --only test, deps.compile
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
- name: Cache Dialyzer's PLT
uses: actions/cache@v2
id: cache-plt
with:
path: priv/plts
key: ${{ runner.os }}-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}
# Create PLTs if no cache was found
- name: Create PLTs
if: ${{matrix.dialyzer && steps.cache-plt.outputs.cache-hit != 'true'}}
run: mix dialyzer --plt
- name: Check for unused dependencies
run: mix do deps.get, deps.unlock --check-unused
if: ${{ matrix.lint && steps.cache-deps.outputs.cache-hit != 'true'}}
- name: Compile with --warnings-as-errors
run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- name: Check mix format
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Run tests
run: mix test --trace
if: ${{ !matrix.coverage }}
- name: Run tests with coverage
run: mix coveralls.github
if: ${{ matrix.coverage }}
- name: Run Dialyzer
run: mix dialyzer
if: ${{ matrix.dialyzer }}