diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8f756090 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: Ruby Test ๐Ÿ’Ž + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + name: ๐Ÿ’Ž Test with Ruby ${{ matrix.ruby-version }} + strategy: + fail-fast: false + matrix: + ruby-version: + - '3.1.7' + - '3.2.8' + - '3.3.8' + - '3.4.4' + + runs-on: ubuntu-22.04 + + steps: + - name: ๐Ÿ”„ Checkout Repository + uses: actions/checkout@v4 + + - name: ๐Ÿ› ๏ธ Setup Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + + - name: โ˜๏ธ Set up test cloud + run: | + export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh) + echo "CLOUDINARY_URL=$CLOUDINARY_URL" >> $GITHUB_ENV + echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)" + + - name: ๐Ÿงช Run tests + run: bundle exec rspec --format documentation --color + env: + CLOUDINARY_URL: ${{ env.CLOUDINARY_URL }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1282bad5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -dist: jammy -language: ruby -rvm: - - 3.1.4 - - 3.2.2 - - 3.3.0 - -matrix: - include: - # There is an OpenSSL issue on Jammy with Ruby 3.0 - - name: "Ruby: 3.0.6" - dist: focal - rvm: 3.0.6 - -before_script: > - export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh); - echo cloud_name: "$(echo $CLOUDINARY_URL | cut -d'@' -f2)" -script: bundle exec rspec - -notifications: - email: - recipients: - - sdk_developers@cloudinary.com diff --git a/spec/uploader_spec.rb b/spec/uploader_spec.rb index 68f4f0fb..02fd6f79 100644 --- a/spec/uploader_spec.rb +++ b/spec/uploader_spec.rb @@ -627,7 +627,9 @@ end it "should fail if timeout is reached" do - expect { Cloudinary::Uploader.upload(Pathname.new(TEST_IMG), :tags => [TEST_TAG, TIMESTAMP_TAG]) }.to raise_error(Faraday::ConnectionFailed) + expect { Cloudinary::Uploader.upload(Pathname.new(TEST_IMG), :tags => [TEST_TAG, TIMESTAMP_TAG]) }.to raise_error { |error| + expect([Faraday::ConnectionFailed, Faraday::TimeoutError]).to include(error.class) + } end it "should allow passing nil value" do