Skip to content

test

test #316

Workflow file for this run

name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- elixir: 1.17.x
otp: 27.x
check_formatted: true
search: elasticsearch-7.6.0
- elixir: 1.17.x
otp: 27.x
search: elasticsearch-8.2.0
- elixir: 1.17.x
otp: 27.x
search: opensearch-2.6.0
- elixir: 1.17.x
otp: 27.x
search: opensearch-2.13.0
- elixir: 1.16.x
otp: 26.x
search: elasticsearch-7.6.0
- elixir: 1.15.x
otp: 26.x
search: elasticsearch-7.6.0
- elixir: 1.14.x
otp: 25.x
search: elasticsearch-7.6.0
- elixir: 1.13.x
otp: 24.x
search: elasticsearch-7.6.0
- elixir: 1.12.x
otp: 24.x
search: elasticsearch-7.6.0
steps:
- uses: actions/checkout@v4
- id: search
run: |
version=$(echo ${{ matrix.search }} | cut -d- -f2)
service=$(echo ${{ matrix.search }} | cut -d- -f1)
echo "::set-output name=version::$version"
echo "::set-output name=service::$service"
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Run Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: ${{ steps.search.outputs.version }}
security-enabled: false
if: ${{ steps.search.outputs.service == 'elasticsearch' }}
- name: Run OpenSearch
uses: ankane/setup-opensearch@v1
with:
opensearch-version: ${{ steps.search.outputs.version }}
if: ${{ steps.search.outputs.service == 'opensearch' }}
- uses: erlef/setup-beam@v1
id: setup-elixir
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v3
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Check Formatting
run: mix format --check-formatted
if: matrix.check_formatted
- name: Run credo
run: mix credo
if: matrix.check_formatted
- name: Run tests
run: mix test --include integration
- name: Retrieve PLT Cache
uses: actions/cache@v3
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-plts-
- name: Make plts path if not present
run: mkdir -p priv/plts
- name: Run dialyzer
run: mix dialyzer