Updated dependencies #203
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- "*" | |
paths-ignore: | |
- "*.md" | |
tags-ignore: | |
- "*" | |
pull_request: | |
concurrency: | |
group: ${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
env: | |
HEX_HTTP_TIMEOUT: 120 | |
jobs: | |
format: | |
name: Check formatting | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Set up Erlang and Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
version-type: "strict" | |
version-file: ".tool-versions" | |
install-hex: true | |
install-rebar: true | |
- name: Restore formatting environment | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-format | |
path: | | |
deps/ | |
_build/dev/ | |
- name: Fetch the dependencies | |
run: mix deps.get | |
- name: Format code | |
run: mix format --check-formatted | |
credo: | |
name: Run Credo | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Set up Erlang and Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
version-type: "strict" | |
version-file: ".tool-versions" | |
install-hex: true | |
install-rebar: true | |
- name: Restore Credo environment | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-credo | |
path: | | |
deps/ | |
_build/dev/ | |
- name: Fetch the dependencies | |
run: mix deps.get | |
- name: Run credo | |
run: mix credo --format sarif | |
dialyxir: | |
name: Run Dialyxir | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 20 | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Set up Erlang and Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
version-type: "strict" | |
version-file: ".tool-versions" | |
install-hex: true | |
install-rebar: true | |
- name: Restore PLT cache | |
id: plt_cache | |
uses: actions/cache/restore@v3 | |
with: | |
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-dialyxir-${{ hashFiles('mix.lock') }} | |
restore-keys: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-dialyxir- | |
path: | | |
deps/ | |
_build/dev/ | |
- name: Create PLTs | |
if: steps.plt_cache.outputs.cache-hit != 'true' | |
run: | | |
mix deps.get | |
mix dialyzer --plt | |
- name: Save PLT cache | |
uses: actions/cache/save@v3 | |
if: steps.plt_cache.outputs.cache-hit != 'true' | |
with: | |
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-dialyxir-${{ hashFiles('mix.lock') }} | |
path: | | |
deps/ | |
_build/dev/ | |
- name: Run dialyzer | |
run: mix dialyzer --format github | |
test: | |
name: Run tests | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
# Elixir 1.16.2 / Elasticsearch 8.13.0 | |
- elixir: "1.16.2" | |
erlang: "26.2.3" | |
elasticsearch: "8.13.0" | |
- elixir: "1.16.2" | |
erlang: "25.3.2.10" | |
elasticsearch: "8.13.0" | |
- elixir: "1.16.2" | |
erlang: "24.3.4.17" | |
elasticsearch: "8.13.0" | |
# Elixir 1.16.2 / Elasticsearch 7.17.16 | |
# - elixir: "1.16.2" | |
# erlang: "26.2.3" | |
# elasticsearch: "7.17.16" | |
# - elixir: "1.16.2" | |
# erlang: "25.3.2.10" | |
# elasticsearch: "7.17.16" | |
# - elixir: "1.16.2" | |
# erlang: "24.3.4.17" | |
# elasticsearch: "7.17.16" | |
# Elixir 1.15.7 / Elasticsearch 8.13.0 | |
- elixir: "1.15.7" | |
erlang: "26.2.3" | |
elasticsearch: "8.13.0" | |
- elixir: "1.15.7" | |
erlang: "25.3.2.10" | |
elasticsearch: "8.13.0" | |
- elixir: "1.15.7" | |
erlang: "24.3.4.17" | |
elasticsearch: "8.13.0" | |
# Elixir 1.15.7 / Elasticsearch 7.17.16 | |
# - elixir: "1.15.7" | |
# erlang: "26.2.3" | |
# elasticsearch: "7.17.16" | |
# - elixir: "1.15.7" | |
# erlang: "25.3.2.10" | |
# elasticsearch: "7.17.16" | |
# - elixir: "1.15.7" | |
# erlang: "24.3.4.17" | |
# elasticsearch: "7.17.16" | |
# Elixir 1.14.5 / Elasticsearch 8.13.0 | |
- elixir: "1.14.5" | |
erlang: "26.2.3" | |
elasticsearch: "8.13.0" | |
- elixir: "1.14.5" | |
erlang: "25.3.2.10" | |
elasticsearch: "8.13.0" | |
- elixir: "1.14.5" | |
erlang: "24.3.4.17" | |
elasticsearch: "8.13.0" | |
# Elixir 1.14.5 / Elasticsearch 7.17.16 | |
# - elixir: "1.14.5" | |
# erlang: "26.2.3" | |
# elasticsearch: "7.17.16" | |
# - elixir: "1.14.5" | |
# erlang: "25.3.2.10" | |
# elasticsearch: "7.17.16" | |
# - elixir: "1.14.5" | |
# erlang: "24.3.4.17" | |
# elasticsearch: "7.17.16" | |
# Elixir 1.13.4 / Elasticsearch 8.13.0 | |
- elixir: "1.13.4" | |
erlang: "25.3.2.10" | |
elasticsearch: "8.13.0" | |
- elixir: "1.13.4" | |
erlang: "24.3.4.17" | |
elasticsearch: "8.13.0" | |
# Elixir 1.13.4 / Elasticsearch 7.17.16 | |
# - elixir: "1.13.4" | |
# erlang: "25.3.2.10" | |
# elasticsearch: "7.17.16" | |
# - elixir: "1.13.4" | |
# erlang: "24.3.4.17" | |
# elasticsearch: "7.17.16" | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch }} | |
ports: ["9200:9200"] | |
env: | |
discovery.type: "single-node" | |
ELASTIC_PASSWORD: "elastic" | |
ES_JAVA_OPTS: "-Xms512m -Xmx512m" | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Set up Erlang and Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.erlang }} | |
elixir-version: ${{ matrix.elixir }} | |
install-hex: true | |
install-rebar: true | |
- name: Restore formatting environment | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-${{ runner.arch }}-erlang-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-elasticsearch-${{ matrix.elasticsearch }}-test | |
path: | | |
deps/ | |
_build/test/ | |
- name: Fetch the dependencies | |
run: mix deps.get | |
- name: Compile the project | |
env: | |
MIX_ENV: test | |
run: mix compile | |
- name: Wait for Elasticsearch | |
run: | | |
until $(curl --output /dev/null --silent --head --fail --insecure --user "elastic:elastic" "https://localhost:9200"); do | |
printf '.' | |
sleep 1 | |
done | |
result=$(curl --silent --insecure --user "elastic:elastic" "https://localhost:9200/_cluster/health?wait_for_status=green&timeout=50s") | |
if [[ "$(cat $result | jq -r .timed_out)" = "true" ]]; then | |
echo "Elasticsearch is not ready" | |
exit 1 | |
fi | |
- name: Run tests | |
run: mix test |