Skip to content

feat!: be resilient to LSP protocol errors #156

feat!: be resilient to LSP protocol errors

feat!: be resilient to LSP protocol errors #156

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: main
jobs:
tests:
runs-on: ubuntu-20.04
name: Test (${{matrix.elixir}}/${{matrix.otp}})
strategy:
matrix:
otp: [23.x, 24.x, 25.x, 26.x]
elixir: [1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x]
exclude:
- otp: 26.x
elixir: 1.11.x
- otp: 26.x
elixir: 1.12.x
- otp: 26.x
elixir: 1.13.x
- otp: 25.x
elixir: 1.11.x
- otp: 25.x
elixir: 1.12.x
- otp: 23.x
elixir: 1.15.x
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{matrix.otp}}-${{matrix.elixir}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{matrix.otp}}-${{matrix.elixir}}-
- name: Install Dependencies
run: mix deps.get
- name: Run Tests
run: mix test || mix test --failed || mix test --failed
formatter:
runs-on: ubuntu-latest
name: Formatter (1.15.x.x/26.x)
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: 26.x
elixir-version: 1.15.x
- uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-24-1.15-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-24-1.15-
- name: Install Dependencies
run: mix deps.get
- name: Run Formatter
run: mix format --check-formatted
dialyzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: 26.x
elixir-version: 1.15.x
# 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: Restore PLT cache
uses: actions/cache/restore@v3
id: plt_cache
with:
key: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
path: |
priv/plts
- name: Install Dependencies
run: mix deps.get
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
# By default, the GitHub Cache action will only save the cache if all steps in the job succeed,
# so we separate the cache restore and save steps in case running dialyzer fails.
- name: Save PLT cache
uses: actions/cache/save@v3
if: steps.plt_cache.outputs.cache-hit != 'true'
id: plt_cache_save
with:
key: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
path: |
priv/plts
- name: Run dialyzer
run: mix dialyzer --format github