Skip to content

Commit ba2210a

Browse files
authored
Adds github workflow ci action (#5)
* Add github ci workflow * Drop travis
1 parent d256b14 commit ba2210a

File tree

6 files changed

+69
-39
lines changed

6 files changed

+69
-39
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
pull_request:
7+
branches: ["*"]
8+
9+
jobs:
10+
lint:
11+
runs-on: ${{ matrix.os }}
12+
env:
13+
MIX_ENV: dev
14+
name: Lint
15+
strategy:
16+
matrix:
17+
os: ["ubuntu-20.04"]
18+
elixir: ["1.15"]
19+
otp: ["26"]
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: erlef/setup-beam@v1
23+
with:
24+
otp-version: ${{ matrix.otp }}
25+
elixir-version: ${{ matrix.elixir }}
26+
- uses: actions/cache@v3
27+
with:
28+
path: deps
29+
key: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_${{ hashFiles('**/mix.lock') }}
30+
restore-keys: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_
31+
- run: mix deps.get
32+
- run: mix deps.compile
33+
- run: mix lint
34+
35+
test:
36+
runs-on: ${{ matrix.os }}
37+
name: Test Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }}, OS ${{ matrix.os }}
38+
env:
39+
MIX_ENV: test
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
os: ["ubuntu-20.04"]
44+
elixir: ["1.15", "1.14", "1.13"]
45+
otp: ["26", "25", "24"]
46+
exclude:
47+
- elixir: "1.13"
48+
otp: "26"
49+
steps:
50+
- uses: actions/checkout@v3
51+
- uses: erlef/setup-beam@v1
52+
with:
53+
otp-version: ${{ matrix.otp }}
54+
elixir-version: ${{ matrix.elixir }}
55+
- uses: actions/cache@v3
56+
with:
57+
path: deps
58+
key: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_${{ hashFiles('**/mix.lock') }}
59+
restore-keys: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_
60+
- run: mix deps.get --only test
61+
- run: mix deps.compile
62+
- run: mix compile
63+
- run: mix test

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

lib/ex_image_info.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
defmodule ExImageInfo do
2-
3-
alias ExImageInfo.Types.{PNG, GIF, JPEG, BMP, TIFF, WEBP, PSD, JP2, PNM, ICO}
2+
alias ExImageInfo.Types.{BMP, GIF, ICO, JP2, JPEG, PNG, PNM, PSD, TIFF, WEBP}
43

54
@moduledoc """
65
ExImageInfo is an Elixir library to parse images (binaries) and get the dimensions (size), detected mime-type and overall validity for a set of image formats. Main module to parse a binary and get if it seems to be an image (validity), the mime-type (and variant detected) and the dimensions of the image, based on a specific image format.

mix.exs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ defmodule ExImageInfo.Mixfile do
3737
defp aliases do
3838
[
3939
test_wip: ["test --only wip"],
40-
docs: ["docs", &copy_doc_to_docs/1]
40+
docs: ["docs", &copy_doc_to_docs/1],
41+
lint: [
42+
"deps.unlock --check-unused",
43+
"credo --all --strict"
44+
]
4145
]
4246
end
4347

test/ex_image_info_test/images/gif_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ defmodule ExImageInfoTest.Images.GIFTest do
1212
{:ok, images}
1313
end
1414

15-
1615
test "force - gif (gif87a, gif89a) disk image - #seems? #type #info", images do
1716
assert seems?(images["gif87a"], :gif) == true
1817
assert seems?(images["gif89a"], :gif) == true

test/ex_image_info_test/images/png_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ defmodule ExImageInfoTest.Images.PNGTest do
1010
{:ok, images}
1111
end
1212

13-
1413
test "force - png disk image - #seems? #type #info", images do
1514
assert seems?(images["png"], :png) == true
1615
assert type(images["png"], :png) == {"image/png", "PNG"}

0 commit comments

Comments
 (0)