Skip to content

Commit

Permalink
ci: test with Elixir version from 1.13 to 1.17
Browse files Browse the repository at this point in the history
Also, bump actions/cache to v4 and use erlef/setup-beam@v rather than erlef/setup-elixir@v1.
  • Loading branch information
ahamez committed Nov 14, 2024
1 parent b5c84dc commit 6d2ccc2
Showing 1 changed file with 60 additions and 67 deletions.
127 changes: 60 additions & 67 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,86 +6,79 @@ env:

on:
push:
branches: [ master ]
branches: ["**"]
pull_request:
branches: [ master ]
branches: ["**"]

jobs:
build:

runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
fail-fast: false
matrix:
include:
- elixir: 1.13.4
otp: 25.2
check_deps: true
check_format: true
credo: true
dialyzer: true
- elixir: 1.14.2
otp: 25.2
check_deps: true
- elixir: "1.14"
otp: "25"
- elixir: "1.15"
otp: "26"
- elixir: "1.16"
otp: "26"
- elixir: "1.17"
otp: "27"
check_format: true
credo: true
dialyzer: true
- elixir: 1.15.7
otp: 26.1.2
check_deps: true
check_format: true
credo: true
dialyzer: true

steps:
- uses: actions/checkout@v4

- name: Install inotify-tools
run: sudo apt-get install -y inotify-tools

- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: ${{matrix.elixir}}
otp-version: ${{matrix.otp}}

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }}

- name: Restore PLT cache
uses: actions/cache@v3
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }}

- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile prod with warnings as errors
run: MIX_ENV=prod mix compile --warnings-as-errors

- name: Run tests
run: mix coveralls.github

- name: Check formatting
run: mix format --check-formatted
if: ${{ matrix.check_format }}

- name: Check dependencies
run: mix deps.unlock --check-unused
if: ${{ matrix.check_deps }}

- name: Credo
run: mix credo
if: ${{ matrix.credo }}

- name: Dialyzer
run: mix dialyzer
if: ${{ matrix.dialyzer }}
- uses: actions/checkout@v4

- name: Install inotify-tools
run: sudo apt-get install -y inotify-tools

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{matrix.elixir}}
otp-version: ${{matrix.otp}}

- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }}

- name: Restore PLT cache
uses: actions/cache@v3
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }}

- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile prod with warnings as errors
run: MIX_ENV=prod mix compile --warnings-as-errors

- name: Run tests
run: mix coveralls.github

- name: Check formatting
run: mix format --check-formatted
if: ${{ matrix.check_format }}

- name: Check dependencies
run: mix deps.unlock --check-unused
if: ${{ matrix.check_deps }}

- name: Credo
run: mix credo
if: ${{ matrix.credo }}

- name: Dialyzer
run: mix dialyzer
if: ${{ matrix.dialyzer }}

0 comments on commit 6d2ccc2

Please sign in to comment.