Skip to content

Commit fa6d8c6

Browse files
committed
Add GitHub Actions CI
1 parent 61694f1 commit fa6d8c6

3 files changed

Lines changed: 70 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
elixir: ['1.15', '1.16', '1.17']
16+
otp: ['25', '26', '27']
17+
exclude:
18+
- elixir: '1.15'
19+
otp: '27'
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: erlef/setup-beam@v1
25+
with:
26+
elixir-version: ${{ matrix.elixir }}
27+
otp-version: ${{ matrix.otp }}
28+
29+
- name: Restore dependencies cache
30+
uses: actions/cache@v4
31+
with:
32+
path: deps
33+
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
34+
restore-keys: ${{ runner.os }}-mix-
35+
36+
- name: Install dependencies
37+
run: mix deps.get
38+
39+
- name: Run tests
40+
run: mix test
41+
42+
lint:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- uses: erlef/setup-beam@v1
49+
with:
50+
elixir-version: '1.17'
51+
otp-version: '27'
52+
53+
- name: Restore dependencies cache
54+
uses: actions/cache@v4
55+
with:
56+
path: deps
57+
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
58+
restore-keys: ${{ runner.os }}-mix-
59+
60+
- name: Install dependencies
61+
run: mix deps.get
62+
63+
- name: Check formatting
64+
run: mix format --check-formatted
65+
66+
- name: Compile with warnings as errors
67+
run: mix compile --warnings-as-errors

lib/iconify/fetcher.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ defmodule Iconify.Fetcher do
5656
# => %{"user" => %Icon{}, "home" => %Icon{}}
5757
5858
"""
59-
@spec fetch_icons(String.t(), [String.t()]) :: {:ok, %{String.t() => Icon.t()}} | {:error, term()}
59+
@spec fetch_icons(String.t(), [String.t()]) ::
60+
{:ok, %{String.t() => Icon.t()}} | {:error, term()}
6061
def fetch_icons(prefix, names) when is_binary(prefix) and is_list(names) do
6162
ensure_req!()
6263

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Iconify.MixProject do
22
use Mix.Project
33

44
@version "0.1.0"
5-
@source_url "https://github.com/TODO/iconify"
5+
@source_url "https://github.com/dannote/iconify"
66

77
def project do
88
[

0 commit comments

Comments
 (0)