Skip to content

Commit 0d0d9a4

Browse files
authored
Move from Travis CI to GitHub CI (#93)
* Move from Travis CI to GitHub CI * Update error message * Fix Ruby 2.3 compatibility
1 parent 52d5126 commit 0d0d9a4

File tree

4 files changed

+56
-30
lines changed

4 files changed

+56
-30
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ '**' ]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
ruby:
16+
- "2.3"
17+
- "2.4"
18+
- "2.5"
19+
- "2.6"
20+
- "2.7"
21+
- "3.0"
22+
- "jruby-9.2"
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Set up Ruby
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ${{ matrix.ruby }}
31+
bundler-cache: true
32+
33+
- name: Update apt
34+
env:
35+
DEBIAN_FRONTEND: noninteractive
36+
run:
37+
sudo apt-get update -qq -o Acquire::Retries=3
38+
39+
- name: Install ImageMagick
40+
env:
41+
DEBIAN_FRONTEND: noninteractive
42+
run:
43+
sudo apt-get install -qq -o Acquire::Retries=3 imagemagick graphicsmagick
44+
45+
- name: Install libvips
46+
env:
47+
DEBIAN_FRONTEND: noninteractive
48+
run:
49+
sudo apt-get install --fix-missing -qq -o Acquire::Retries=3 libvips
50+
51+
- name: Run tests
52+
run: bundle exec rake test

.travis.yml

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

lib/image_processing/chainable.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def operation(name, *args, &block)
5353
# Call the defined processing and get the result. Allows specifying
5454
# the source file and destination.
5555
def call(file = nil, destination: nil, **call_options)
56-
options = { source: file, destination: destination }.compact
56+
options = {}
57+
options[:source] = file if file
58+
options[:destination] = destination if destination
5759

5860
branch(**options).call!(**call_options)
5961
end

test/vips_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115

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

121121
it "accepts :saver" do

0 commit comments

Comments
 (0)