diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index f3939daf..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,84 +0,0 @@ -version: 2.1 - -defaults: &defaults - working_directory: &working_directory ~/mavenlink/mavenlink_gem - parallelism: 1 - shell: /bin/bash --login - environment: - RACK_ENV: "test" - RAILS_ENV: "test" - docker: - - image: circleci/ruby:2.3.3 - -workflows: - version: 2 - test: - jobs: - - build - - rspec: - requires: - - build - - rubocop: - requires: - - build - -commands: - store_output: - description: "Standardizes where test artifacts are stored" - steps: - - store_artifacts: - path: /tmp/circle/test_reports - - store_test_results: - path: /tmp/circle/test_reports - -jobs: - build: - <<: *defaults - steps: - - checkout - - restore_cache: - keys: - - v1-dep-{{ .Branch }}- - - v1-dep-master- - - v1-dep- - - run: gem install bundler -v "=1.13.6" - - run: mkdir -p tmp/cache - - run: - name: bundle - command: | - bundle check --path=~/mavenlink/mavenlink_gem/bundle || bundle install --path=~/mavenlink/mavenlink_gem/bundle --jobs=4 --retry=3 - - save_cache: - key: v1-dep-{{ .Branch }}-{{ epoch }} - paths: - - ~/mavenlink/mavenlink_gem/bundle - - persist_to_workspace: - root: ~/mavenlink/mavenlink_gem - paths: - - .bundle - - bundle - rspec: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/mavenlink/mavenlink_gem - - run: gem install bundler -v "=1.13.6" - - run: bundle install - - run: - name: Run RSpec tests - command: | - bundle exec rspec --color --format progress --format json --out /tmp/circle/test_reports/rspec-results.json - - store_output - rubocop: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/mavenlink/mavenlink_gem - - run: gem install bundler -v "=1.13.6" - - run: bundle install - - run: - name: Run RuboCop - command: | - bundle exec rubocop --format progress --format json --out /tmp/circle/test_reports/rubocop-results.json - - store_output diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..62aad1fa --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,47 @@ +name: test + +on: + push: + branches: + - master + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + env: + RACK_ENV: "test" + RAILS_ENV: "test" + steps: + - uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: rspec + run: bundle exec rspec --color --format progress --format json --out ./rspec-results.json + - name: Archive + uses: actions/upload-artifact@v3 + with: + name: rspec-report + path: | + .resultset.json + rubocop: + runs-on: ubuntu-latest + env: + RACK_ENV: "test" + RAILS_ENV: "test" + steps: + - uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: rubocop + run: bundle exec rubocop --format progress --format json --out ./rubocop-results.json + - name: Archive + uses: actions/upload-artifact@v3 + with: + name: rubocop-report + path: | + ./rubocop-results.json \ No newline at end of file diff --git a/.ruby-version b/.ruby-version index 0bee604d..49cdd668 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.3 +2.7.6 diff --git a/lib/mavenlink.rb b/lib/mavenlink.rb index 7a0d9c58..e1cf4d38 100644 --- a/lib/mavenlink.rb +++ b/lib/mavenlink.rb @@ -10,6 +10,7 @@ require "json" require "brainstem-adaptor" require "faraday" +require "faraday/multipart" require "forwardable" module Mavenlink diff --git a/mavenlink.gemspec b/mavenlink.gemspec index ae6b5d09..999f6950 100644 --- a/mavenlink.gemspec +++ b/mavenlink.gemspec @@ -17,10 +17,12 @@ Gem::Specification.new do |s| s.description = "Simple Ruby API for the Mavenlink API" s.summary = "Mavenlink API Ruby Wrapper" + s.required_ruby_version = ">= 2.7.0" s.add_runtime_dependency "activemodel", ">= 4.2" s.add_runtime_dependency "activesupport", ">= 4.2" s.add_runtime_dependency "brainstem-adaptor", ">= 0.0.4" - s.add_runtime_dependency "faraday", ">= 0.9.0" + s.add_runtime_dependency "faraday", ">= 2.7.0" + s.add_runtime_dependency "faraday-multipart", ">= 1.0.0" s.add_development_dependency "awesome_print", "~> 1.8" s.add_development_dependency "rspec", "~> 3.0" s.add_development_dependency "rubocop", "~> 0.74" diff --git a/spec/lib/mavenlink/workspace_spec.rb b/spec/lib/mavenlink/workspace_spec.rb index d913bdf0..049a0676 100644 --- a/spec/lib/mavenlink/workspace_spec.rb +++ b/spec/lib/mavenlink/workspace_spec.rb @@ -410,21 +410,17 @@ specify do expect do - begin - subject.save! - rescue StandardError - nil - end + subject.save! + rescue StandardError + nil end .not_to change(subject, :persisted?) end it "does not perform any requests" do expect do - begin - subject.save! - rescue StandardError - nil - end + subject.save! + rescue StandardError + nil end .not_to change { subject.title } end end @@ -441,21 +437,17 @@ specify do expect do - begin - subject.save! - rescue StandardError - nil - end + subject.save! + rescue StandardError + nil end .not_to change(subject, :persisted?) end it "does not change anything" do expect do - begin - subject.save! - rescue StandardError - nil - end + subject.save! + rescue StandardError + nil end .not_to change { subject.title } end end