Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds github workflow ci action #5

Merged
merged 4 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches: ["*"]
pull_request:
branches: ["*"]

jobs:
lint:
runs-on: ${{ matrix.os }}
env:
MIX_ENV: dev
name: Lint
strategy:
matrix:
os: ["ubuntu-20.04"]
elixir: ["1.15"]
otp: ["26"]
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- uses: actions/cache@v3
with:
path: deps
key: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_
- run: mix deps.get
- run: mix deps.compile
- run: mix lint

test:
runs-on: ${{ matrix.os }}
name: Test Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }}, OS ${{ matrix.os }}
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
elixir: ["1.15", "1.14", "1.13"]
otp: ["26", "25", "24"]
exclude:
- elixir: "1.13"
otp: "26"
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- uses: actions/cache@v3
with:
path: deps
key: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ matrix.os }}-otp_${{ matrix.otp }}-elixir_${{ matrix.elixir }}-mix_
- run: mix deps.get --only test
- run: mix deps.compile
- run: mix compile
- run: mix test
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions lib/ex_image_info.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
defmodule ExImageInfo do

alias ExImageInfo.Types.{PNG, GIF, JPEG, BMP, TIFF, WEBP, PSD, JP2, PNM, ICO}
alias ExImageInfo.Types.{BMP, GIF, ICO, JP2, JPEG, PNG, PNM, PSD, TIFF, WEBP}

@moduledoc """
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.
Expand Down
6 changes: 5 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ defmodule ExImageInfo.Mixfile do
defp aliases do
[
test_wip: ["test --only wip"],
docs: ["docs", &copy_doc_to_docs/1]
docs: ["docs", &copy_doc_to_docs/1],
lint: [
"deps.unlock --check-unused",
"credo --all --strict"
]
]
end

Expand Down
1 change: 0 additions & 1 deletion test/ex_image_info_test/images/gif_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ defmodule ExImageInfoTest.Images.GIFTest do
{:ok, images}
end


test "force - gif (gif87a, gif89a) disk image - #seems? #type #info", images do
assert seems?(images["gif87a"], :gif) == true
assert seems?(images["gif89a"], :gif) == true
Expand Down
1 change: 0 additions & 1 deletion test/ex_image_info_test/images/png_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ defmodule ExImageInfoTest.Images.PNGTest do
{:ok, images}
end


test "force - png disk image - #seems? #type #info", images do
assert seems?(images["png"], :png) == true
assert type(images["png"], :png) == {"image/png", "PNG"}
Expand Down
Loading