Skip to content

Commit 60f8993

Browse files
committed
Provision Erlang/OTP and Elixir from a version matrix
Run on every supported version of elixir having > OTP 24
1 parent 018c4a9 commit 60f8993

2 files changed

Lines changed: 48 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,59 @@
11
name: "CI"
2-
on: ["push", "pull_request"]
2+
on:
3+
- push
4+
- pull_request
35

46
jobs:
57
test_and_build:
6-
name: "Compile & Lint"
7-
runs-on: "ubuntu-latest"
8+
name: >-
9+
Test on
10+
Elixir ${{ matrix.elixir }} and Erlang/OTP ${{ matrix.otp }}
11+
${{ matrix.update-deps && 'with the latest dependencies' }}
12+
runs-on: "ubuntu-22.04"
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
# Test on all supported releases. Compatibility matrix from
18+
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html
19+
#
20+
# These pin to the lowest supported OTP for each elixir release.
21+
- { elixir: '1.15', otp: '24' }
22+
- { elixir: '1.16', otp: '24' }
23+
- { elixir: '1.17', otp: '25' }
24+
- { elixir: '1.18', otp: '25' }
25+
- { elixir: '1.18', otp: '25', update-deps: true }
826
steps:
927
- name: Setup elixir
1028
uses: erlef/setup-beam@v1
1129
with:
12-
otp-version: 24.3.3
13-
elixir-version: 1.16.3
30+
elixir-version: ${{ matrix.elixir }}
31+
otp-version: ${{ matrix.otp }}
1432

15-
- uses: actions/checkout@v1
16-
- run: mix deps.get
33+
- uses: actions/checkout@v3
1734

18-
- uses: actions/cache@v2
35+
- name: Setup dependency cache
36+
uses: actions/cache@v3
1937
id: mix-cache
38+
with:
39+
path: |
40+
deps
41+
key: mix-${{ hashFiles('mix.lock') }}
42+
43+
- name: Setup binary cache
44+
uses: actions/cache@v3
2045
with:
2146
path: |
2247
./_build
2348
./priv/plts
24-
key: deps-${{ hashFiles('**/mix.lock') }}
49+
key: ${{ matrix.elixir }}-${{ matrix.otp }}
50+
51+
- name: Unlock dependencies to get latest
52+
if: ${{ matrix.update-deps }}
53+
run: mix deps.unlock --all
54+
55+
- name: Fetch dependencies
56+
run: mix deps.get
2557

2658
- if: steps.mix-cache.outputs.cache-hit != 'true'
2759
run: |
@@ -31,5 +63,9 @@ jobs:
3163
mix deps.compile
3264
mix dialyzer --plt
3365
34-
- run: |
35-
mix lint
66+
- name: Run linters
67+
run: mix lint
68+
69+
- name: Run test
70+
run: |
71+
mix test

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Desktop.MixProject do
1414
version: @version,
1515
source_url: @url,
1616
description: @description,
17-
elixir: "~> 1.11",
17+
elixir: "~> 1.14",
1818
elixirc_paths: elixirc_paths(Mix.env()),
1919
compilers: Mix.compilers(),
2020
aliases: aliases(),

0 commit comments

Comments
 (0)