Skip to content

Commit

Permalink
Move from Travis CI to GitHub CI (#93)
Browse files Browse the repository at this point in the history
* Move from Travis CI to GitHub CI

* Update error message

* Fix Ruby 2.3 compatibility
  • Loading branch information
janko committed Sep 12, 2021
1 parent 52d5126 commit 0d0d9a4
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 30 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ '**' ]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "2.3"
- "2.4"
- "2.5"
- "2.6"
- "2.7"
- "3.0"
- "jruby-9.2"

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Update apt
env:
DEBIAN_FRONTEND: noninteractive
run:
sudo apt-get update -qq -o Acquire::Retries=3

- name: Install ImageMagick
env:
DEBIAN_FRONTEND: noninteractive
run:
sudo apt-get install -qq -o Acquire::Retries=3 imagemagick graphicsmagick

- name: Install libvips
env:
DEBIAN_FRONTEND: noninteractive
run:
sudo apt-get install --fix-missing -qq -o Acquire::Retries=3 libvips

- name: Run tests
run: bundle exec rake test
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion lib/image_processing/chainable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def operation(name, *args, &block)
# Call the defined processing and get the result. Allows specifying
# the source file and destination.
def call(file = nil, destination: nil, **call_options)
options = { source: file, destination: destination }.compact
options = {}
options[:source] = file if file
options[:destination] = destination if destination

branch(**options).call!(**call_options)
end
Expand Down
2 changes: 1 addition & 1 deletion test/vips_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

it "raises correct Vips::Error on unknown saver" do
error = assert_raises(Vips::Error) { ImageProcessing::Vips.convert("foo").call(@portrait) }
assert_includes error.message, "No known saver"
assert_includes error.message, "is not a known file format"
end

it "accepts :saver" do
Expand Down

0 comments on commit 0d0d9a4

Please sign in to comment.