diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 39e02e55..e8a57701 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -15,44 +15,43 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true strategy: matrix: - elixir: ['1.12.3'] - otp: ['24.3.4'] + elixir: ['1.16'] + otp: ['26.2'] steps: - - name: Cancel previous runs - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Github repo - uses: actions/checkout@v2 - - - name: Setup elixir & erlang environment - uses: erlef/setup-beam@v1 - with: - elixir-version: ${{matrix.elixir}} # Define the elixir version [required] - otp-version: ${{matrix.otp}} # Define the OTP version [required] - experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31 - - - name: Retrieve Cached Dependencies - uses: actions/cache@v2 - id: mix-cache - with: - path: | - deps - _build - priv/plts - key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} - - - name: Install Dependencies - if: steps.mix-cache.outputs.cache-hit != 'true' - run: | - mkdir -p priv/plts - mix local.rebar --force - mix local.hex --force - mix deps.get - mix deps.compile - mix dialyzer --plt + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.9.0 + with: + access_token: ${{ github.token }} + + - name: Checkout Github repo + uses: actions/checkout@v2 + + - name: Setup elixir & erlang environment + uses: erlef/setup-beam@v1 + with: + elixir-version: ${{matrix.elixir}} # Define the elixir version [required] + otp-version: ${{matrix.otp}} # Define the OTP version [required] + + - name: Retrieve Cached Dependencies + uses: actions/cache@v2 + id: mix-cache + with: + path: | + deps + _build + priv/plts + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} + + - name: Install Dependencies + if: steps.mix-cache.outputs.cache-hit != 'true' + run: | + mkdir -p priv/plts + mix local.rebar --force + mix local.hex --force + mix deps.get + mix deps.compile + mix dialyzer --plt static_code_analysis: name: Static Code Analysis @@ -64,8 +63,8 @@ jobs: strategy: fail-fast: false matrix: - elixir: ['1.12.3'] - otp: ['24.3.4'] + elixir: ['1.16'] + otp: ['26.2'] steps: - name: Cancel Previous Runs @@ -83,7 +82,6 @@ jobs: with: elixir-version: ${{matrix.elixir}} # Define the elixir version [required] otp-version: ${{matrix.otp}} # Define the OTP version [required] - experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31 - name: Retrieve Cached Dependencies uses: actions/cache@v2 @@ -105,4 +103,4 @@ jobs: run: mix credo - name: Run Dialyzer - run: mix dialyzer --no-check + run: mix dialyzer --no-check \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6950324..73e66583 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,21 +8,19 @@ on: jobs: setup: - name: test / setup + name: test | setup dependencies runs-on: ubuntu-20.04 env: MIX_ENV: test strategy: matrix: pair: + - elixir: 1.16 + otp: 26.1 - elixir: 1.14 - otp: 25.2 - - elixir: 1.13 otp: 24.3 - - elixir: 1.11 - otp: 21.3 - - elixir: 1.8 - otp: 20.3 + - elixir: 1.12 + otp: 22.3 steps: - name: Cancel previous runs @@ -36,21 +34,20 @@ jobs: with: elixir-version: ${{matrix.pair.elixir}} # Define the elixir version [required] otp-version: ${{matrix.pair.otp}} # Define the OTP version [required] - experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31 - name: Retrieve Mix Dependencies Cache uses: actions/cache@v2 id: mix-cache # id to use in retrieve action with: path: deps - key: ${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} - name: Retrieve Mix Dependencies Compilation Cache uses: actions/cache@v2 id: mix-deps-compile-cache # id to use in retrieve action with: path: _build - key: ${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} - name: Install Mix Dependencies if: steps.mix-cache.outputs.cache-hit != 'true' run: | @@ -74,14 +71,12 @@ jobs: fail-fast: false matrix: pair: + - elixir: 1.16 + otp: 26.1 - elixir: 1.14 - otp: 25.2 - - elixir: 1.13 otp: 24.3 - - elixir: 1.11 - otp: 21.3 - - elixir: 1.8 - otp: 20.3 + - elixir: 1.12 + otp: 22.3 steps: - uses: actions/checkout@v2 @@ -90,25 +85,20 @@ jobs: with: elixir-version: ${{matrix.pair.elixir}} # Define the elixir version [required] otp-version: ${{matrix.pair.otp}} # Define the OTP version [required] - experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31 - name: Retrieve Mix Dependencies Cache uses: actions/cache@v2 id: mix-cache # id to use in retrieve action with: path: deps - key: ${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} - name: Retrieve Mix Dependencies Compilation Cache uses: actions/cache@v2 id: mix-deps-compile-cache # id to use in retrieve action with: path: _build - key: ${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} - - name: Docker-compose up - run: ./scripts/docker_up.sh - - name: Docker ps - run: docker ps -a - - name: Run Tests + - name: Run tests run: ./scripts/ci_tests.sh diff --git a/mix.exs b/mix.exs index 5ccaabd1..5c15822a 100644 --- a/mix.exs +++ b/mix.exs @@ -9,12 +9,10 @@ defmodule KafkaEx.Mixfile do [ app: :kafka_ex, version: @version, - elixir: "~> 1.8", + elixir: "~> 1.12", elixirc_paths: elixirc_paths(Mix.env()), dialyzer: [ - plt_add_deps: :transitive, plt_add_apps: [:ssl], - plt_file: {:no_warn, "priv/plts/dialyzer.plt"}, flags: [ :error_handling, :race_conditions @@ -75,11 +73,4 @@ defmodule KafkaEx.Mixfile do links: %{"GitHub" => @source_url} ] end - - defp dialyzer do - [ - plt_core_path: "priv/plts", - plt_file: {:no_warn, "priv/plts/dialyzer.plt"} - ] - end end