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

feature, ci. create github action ci. #88

Merged
merged 4 commits into from
Jun 8, 2022
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
branches: [ master ]
pull_request:
branches: [ '*' ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [3.0, 2.7, 2.6, 2.5]
steps:
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install xmllint
run: sudo apt-get install -y libpng-dev libjpeg-dev
- name: Install dependencies
run: bundle install
- name: Compile
run: bundle exec rake compile
- name: Run tests
run: bundle exec rake
4 changes: 2 additions & 2 deletions test/test_phashion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ def test_mh_hash_for

assert_kind_of Array, hash1
assert_kind_of Array, hash2
assert_in_delta 0.100, Phashion.hamming_distance2(hash1, hash2), 0.028
assert_in_delta 0.100, Phashion.hamming_distance2(hash1, hash2), 0.033
end

def test_mh_distance_from
jpg = File.dirname(__FILE__) + '/jpg/Broccoli_Super_Food.jpg'
png = File.dirname(__FILE__) + '/png/Broccoli_Super_Food.png'

assert_in_delta 0.100, Phashion::Image.new(jpg).mh_distance_from(Phashion::Image.new(png)), 0.028
assert_in_delta 0.100, Phashion::Image.new(jpg).mh_distance_from(Phashion::Image.new(png)), 0.033
end

def test_duplicate_detection
Expand Down