Skip to content

Commit ec19791

Browse files
authored
CI updates and matrix of Elixir/Erlang versions (#29)
This change updates the CI so: - We test different Elixir/Erlang versions - We test that there are no unused versions in the mix.lock - Credo version is updated - Development versions are updated - Update actions version to avoid deprecations - Do not run CI on guides changes
1 parent 6544261 commit ec19791

File tree

3 files changed

+52
-98
lines changed

3 files changed

+52
-98
lines changed

.github/workflows/elixir.yml

Lines changed: 48 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,75 @@
1-
name: code-analysis
2-
on: push
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- 'guides/**'
8+
pull_request:
9+
paths-ignore:
10+
- 'guides/**'
311
env:
412
MIX_ENV: test
5-
ERLANG_VERSION: 26.0.2
6-
ELIXIR_VERSION: 1.16.0
713

814
jobs:
9-
compile_deps:
15+
code_quality_and_tests:
1016
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- elixir: 1.15.0
22+
erlang: 24.0.0
23+
- elixir: 1.16.0
24+
erlang: 24.0.0
25+
- elixir: 1.17.0
26+
erlang: 27.0.0
27+
services:
28+
db:
29+
image: postgres:15
30+
ports: ["5432:5432"]
31+
env:
32+
POSTGRES_PASSWORD: postgres
33+
options: >-
34+
--health-cmd pg_isready
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
name: Elixir v${{ matrix.elixir }}, Erlang v${{ matrix.erlang }}
1139
steps:
12-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v4
41+
1342
- uses: erlef/setup-beam@v1
1443
with:
15-
otp-version: ${{ env.ERLANG_VERSION }}
16-
elixir-version: ${{ env.ELIXIR_VERSION }}
44+
otp-version: ${{ matrix.erlang }}
45+
elixir-version: ${{ matrix.elixir }}
46+
1747
- name: Retrieve Dependencies Cache
18-
uses: actions/cache@v2
48+
uses: actions/cache@v4
1949
id: mix-cache
2050
with:
2151
path: |
2252
deps
2353
_build
24-
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }}
54+
key: ${{ runner.os }}-${{ matrix.erlang }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }}
55+
2556
- name: Install Mix Dependencies
26-
run: |
27-
mix local.rebar --force
28-
mix local.hex --force
29-
mix deps.get
57+
run: mix deps.get
58+
59+
- name: Check unused dependencies
60+
run: mix deps.unlock --check-unused
61+
3062
- name: Compile dependencies
3163
run: mix deps.compile
3264

33-
check_format:
34-
needs: [compile_deps]
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@v2
38-
- uses: erlef/setup-beam@v1
39-
with:
40-
otp-version: ${{ env.ERLANG_VERSION }}
41-
elixir-version: ${{ env.ELIXIR_VERSION }}
42-
- name: Retrieve Dependencies Cache
43-
uses: actions/cache@v2
44-
id: mix-cache
45-
with:
46-
path: |
47-
deps
48-
_build
49-
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }}
50-
- run: mix format --check-formatted
65+
- name: Check format
66+
run: mix format --check-formatted
5167

52-
check_warnings:
53-
needs: [compile_deps]
54-
runs-on: ubuntu-latest
55-
steps:
56-
- uses: actions/checkout@v2
57-
- uses: erlef/setup-beam@v1
58-
with:
59-
otp-version: ${{ env.ERLANG_VERSION }}
60-
elixir-version: ${{ env.ELIXIR_VERSION }}
61-
- name: Retrieve Mix Dependencies Cache
62-
uses: actions/cache@v2
63-
id: mix-cache
64-
with:
65-
path: |
66-
deps
67-
_build
68-
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }}
6968
- name: Check application compile warnings
7069
run: mix compile --force --warnings-as-errors
7170

72-
check_credo:
73-
needs: [compile_deps]
74-
runs-on: ubuntu-latest
75-
steps:
76-
- uses: actions/checkout@v2
77-
- uses: erlef/setup-beam@v1
78-
with:
79-
otp-version: ${{ env.ERLANG_VERSION }}
80-
elixir-version: ${{ env.ELIXIR_VERSION }}
81-
- name: Retrieve Mix Dependencies Cache
82-
uses: actions/cache@v2
83-
id: mix-cache
84-
with:
85-
path: |
86-
deps
87-
_build
88-
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }}
8971
- name: Check Credo warnings
9072
run: mix credo
9173

92-
run_tests:
93-
needs: [compile_deps]
94-
runs-on: ubuntu-latest
95-
services:
96-
db:
97-
image: postgres:11
98-
ports: ["5432:5432"]
99-
env:
100-
POSTGRES_PASSWORD: postgres
101-
options: >-
102-
--health-cmd pg_isready
103-
--health-interval 10s
104-
--health-timeout 5s
105-
--health-retries 5
106-
steps:
107-
- uses: actions/checkout@v2
108-
- uses: erlef/setup-beam@v1
109-
with:
110-
otp-version: ${{ env.ERLANG_VERSION }}
111-
elixir-version: ${{ env.ELIXIR_VERSION }}
112-
- name: Retrieve Mix Dependencies Cache
113-
uses: actions/cache@v2
114-
id: mix-cache
115-
with:
116-
path: |
117-
deps
118-
_build
119-
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }}
12074
- name: Run Tests
12175
run: mix test

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.16
2-
erlang 26.0.2
1+
elixir 1.17
2+
erlang 27.0

mix.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"},
66
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
77
"cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"},
8-
"credo": {:hex, :credo, "1.7.6", "b8f14011a5443f2839b04def0b252300842ce7388f3af177157c86da18dfbeea", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "146f347fb9f8cbc5f7e39e3f22f70acbef51d441baa6d10169dd604bfbc55296"},
8+
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
99
"db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"},
1010
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
1111
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
1212
"ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"},
1313
"ecto_sql": {:hex, :ecto_sql, "3.11.2", "c7cc7f812af571e50b80294dc2e535821b3b795ce8008d07aa5f336591a185a8", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "73c07f995ac17dbf89d3cfaaf688fcefabcd18b7b004ac63b0dc4ef39499ed6b"},
1414
"ex_doc": {:hex, :ex_doc, "0.33.0", "690562b153153c7e4d455dc21dab86e445f66ceba718defe64b0ef6f0bd83ba0", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "3f69adc28274cb51be37d09b03e4565232862a4b10288a3894587b0131412124"},
1515
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
16-
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
16+
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
1717
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
1818
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
1919
"makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"},

0 commit comments

Comments
 (0)