Skip to content

Commit b7e32d3

Browse files
committed
add CI
1 parent 04d5cc4 commit b7e32d3

File tree

3 files changed

+82
-1
lines changed

3 files changed

+82
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
mix_test:
9+
runs-on: ubuntu-20.04
10+
env:
11+
MIX_ENV: test
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- elixir: "1.16"
17+
otp: "26"
18+
- elixir: "1.17"
19+
otp: "27"
20+
- elixir: "1.18"
21+
otp: "27"
22+
lint: lint
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/cache@v4
26+
with:
27+
path: deps
28+
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
29+
restore-keys: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
30+
- uses: actions/cache@v4
31+
with:
32+
path: _build
33+
key: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
34+
restore-keys: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
35+
- uses: erlef/setup-beam@v1
36+
with:
37+
otp-version: ${{matrix.otp}}
38+
elixir-version: ${{matrix.elixir}}
39+
40+
- name: Dialyzer PLT Cache
41+
uses: actions/cache@v4
42+
if: ${{ matrix.lint }}
43+
id: plt-cache
44+
with:
45+
path: _build/test
46+
key: |
47+
${{ runner.os }}-plt-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}
48+
49+
- name: Install Dependencies
50+
run: mix deps.get
51+
52+
# Create PLTs if no cache was found
53+
- name: Create PLTs
54+
if: ${{ matrix.lint && steps.cache-plt.outputs.cache-hit != 'true' }}
55+
run: mix dialyzer --plt
56+
57+
- run: mix format --check-formatted
58+
if: ${{ matrix.lint }}
59+
60+
- run: mix deps.unlock --check-unused
61+
if: ${{ matrix.lint }}
62+
63+
- run: mix deps.compile
64+
65+
- run: mix compile --warnings-as-errors
66+
if: ${{ matrix.lint }}
67+
68+
- name: Run Tests
69+
run: mix test
70+
if: ${{ ! matrix.lint }}
71+
72+
- name: Run Tests
73+
run: mix test --warnings-as-errors
74+
if: ${{ matrix.lint }}
75+
76+
- name: Run Dialyzer
77+
run: mix dialyzer
78+
if: ${{ matrix.lint }}

mix.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ defmodule GeoSpatialite.MixProject do
2626
[
2727
{:geo, "~> 3.6 or ~> 4.0"},
2828
{:ecto, "~> 3.0", optional: true},
29-
{:ex_doc, "~> 0.29", only: :dev, runtime: false}
29+
{:ex_doc, "~> 0.29", only: :dev, runtime: false},
30+
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
3031
]
3132
end
3233

mix.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
%{
22
"decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
3+
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
34
"earmark_parser": {:hex, :earmark_parser, "1.4.43", "34b2f401fe473080e39ff2b90feb8ddfeef7639f8ee0bbf71bb41911831d77c5", [:mix], [], "hexpm", "970a3cd19503f5e8e527a190662be2cee5d98eed1ff72ed9b3d1a3d466692de8"},
45
"ecto": {:hex, :ecto, "3.12.5", "4a312960ce612e17337e7cefcf9be45b95a3be6b36b6f94dfb3d8c361d631866", [: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", "6eb18e80bef8bb57e17f5a7f068a1719fbda384d40fc37acb8eb8aeca493b6ea"},
6+
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
57
"ex_doc": {:hex, :ex_doc, "0.37.2", "2a3aa7014094f0e4e286a82aa5194a34dd17057160988b8509b15aa6c292720c", [:mix], [{:earmark_parser, "~> 1.4.42", [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", "4dfa56075ce4887e4e8b1dcc121cd5fcb0f02b00391fd367ff5336d98fa49049"},
68
"geo": {:hex, :geo, "4.0.1", "f4ae3fd912b0536bfe9ec3bce15eb554197ab0739c01297c8534c20dcedd561c", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "32eb624feff75d043bbdd43f67e3869c5fc729e221333271b07cdc98ba98563d"},
79
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},

0 commit comments

Comments
 (0)