Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
cabol committed Sep 19, 2023
1 parent 49fa29c commit 978011a
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 76 deletions.
73 changes: 41 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,94 +10,103 @@ on:

jobs:
nebulex_test:
name: 'Nebulex.Adapters.Cachex Test (Elixir ${{ matrix.elixir }} OTP ${{ matrix.otp }})'
runs-on: ubuntu-latest
name: >-
Nebulex.Adapters.Cachex Test (Elixir ${{ matrix.elixir }}
/ OTP ${{ matrix.otp }} / OS ${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- elixir: 1.11.x
otp: 23.x
- elixir: 1.14.x
otp: 25.x
os: 'ubuntu-latest'
style: true
coverage: true
dialyzer: true
- elixir: 1.10.x
- elixir: 1.13.x
otp: 24.x
os: 'ubuntu-latest'
- elixir: 1.12.x
otp: 23.x
- elixir: 1.10.x
otp: 22.x
- elixir: 1.9.x
otp: 22.x
os: 'ubuntu-20.04'

env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
MIX_ENV: test
NEBULEX_PATH: nebulex

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install OTP and Elixir
uses: actions/setup-elixir@v1.5.0
uses: erlef/setup-beam@v1
with:
otp-version: '${{ matrix.otp }}'
elixir-version: '${{ matrix.elixir }}'
experimental-otp: true

- name: Cache deps
uses: actions/cache@v1
uses: actions/cache@v3
id: mix-cache
with:
path: deps
key: >-
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{
hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-
- name: Cache _build
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: _build
key: >-
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{
hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{
hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Nebulex
run: mix nbx.setup

- name: Install Dependencies
run: |
mix local.hex --force
mix local.rebar --force
mix nbx.setup
mix deps.get
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}

- name: Compile code
run: mix compile --warnings-as-errors

- name: Run style and code consistency checks
run: |
mix compile --warnings-as-errors
mix format --check-formatted
mix credo --strict
if: ${{ matrix.style }}

- name: Run tests
run: |
epmd -daemon
mix test --trace
if: ${{!matrix.coverage}}
if: ${{ !matrix.coverage }}

- name: Run tests with coverage
run: |
epmd -daemon
mix coveralls.github
if: ${{matrix.coverage}}
if: ${{ matrix.coverage }}

- name: Cache PLT
uses: actions/cache@v1
- name: Restore PLT Cache
uses: actions/cache@v3
id: plt-cache
with:
path: priv/plts
key: '${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v2'
restore-keys: |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v2
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-v2
if: ${{ matrix.dialyzer }}

- name: Run static analysis checks
- name: Create PLTs
run: |
mix sobelow --exit --skip
mix dialyzer --format short
if: ${{matrix.dialyzer}}
mkdir -p priv/plts
mix dialyzer --plt
if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }}

- name: Run dialyzer
run: mix dialyzer --format github
if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }}
28 changes: 14 additions & 14 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ defmodule NebulexAdaptersCachex.MixProject do
use Mix.Project

@source_url "https://github.com/cabol/nebulex_adapters_cachex"
@version "2.1.0"
@nbx_vsn "2.1.0"
@version "2.1.1"
@nbx_tag "2.5.2"
@nbx_vsn "2.5"

def project do
[
Expand Down Expand Up @@ -50,28 +51,28 @@ defmodule NebulexAdaptersCachex.MixProject do
defp deps do
[
nebulex_dep(),
{:cachex, "~> 3.3"},
{:telemetry, "~> 0.4", optional: true},
{:cachex, "~> 3.6"},
{:telemetry, "~> 0.4 or ~> 1.0", optional: true},

# Test & Code Analysis
{:excoveralls, "~> 0.13", only: :test},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.10", only: [:dev, :test], runtime: false},
{:stream_data, "~> 0.5", only: [:dev, :test]},
{:excoveralls, "~> 0.17", only: :test},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.13", only: [:dev, :test], runtime: false},
{:stream_data, "~> 0.6", only: [:dev, :test]},

# Benchmark Test
{:benchee, "~> 1.0", only: :test},
{:benchee, "~> 1.1", only: :test},
{:benchee_html, "~> 1.0", only: :test},

# Docs
{:ex_doc, "~> 0.23", only: [:dev, :test], runtime: false}
{:ex_doc, "~> 0.30", only: [:dev, :test], runtime: false}
]
end

defp nebulex_dep do
if path = System.get_env("NEBULEX_PATH") do
{:nebulex, "~> #{@nbx_vsn}", path: path}
{:nebulex, "~> #{@nbx_tag}", path: path}
else
{:nebulex, "~> #{@nbx_vsn}"}
end
Expand All @@ -81,7 +82,7 @@ defmodule NebulexAdaptersCachex.MixProject do
[
"nbx.setup": [
"cmd rm -rf nebulex",
"cmd git clone --depth 1 --branch v#{@nbx_vsn} https://github.com/cabol/nebulex"
"cmd git clone --depth 1 --branch v#{@nbx_tag} https://github.com/cabol/nebulex"
],
check: [
"compile --warnings-as-errors",
Expand Down Expand Up @@ -110,7 +111,6 @@ defmodule NebulexAdaptersCachex.MixProject do
flags: [
:unmatched_returns,
:error_handling,
:race_conditions,
:no_opaque,
:unknown,
:no_return
Expand Down
Loading

0 comments on commit 978011a

Please sign in to comment.