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

replace CircleCI with GitHub Actions #240

Merged
merged 3 commits into from
Aug 15, 2023
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
84 changes: 0 additions & 84 deletions .circleci/config.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.7.6
1 change: 1 addition & 0 deletions lib/mavenlink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require "json"
require "brainstem-adaptor"
require "faraday"
require "faraday/multipart"
require "forwardable"

module Mavenlink
Expand Down
4 changes: 3 additions & 1 deletion mavenlink.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 12 additions & 20 deletions spec/lib/mavenlink/workspace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -410,21 +410,17 @@

specify do
expect do
begin
subject.save!
rescue StandardError
nil
end
subject.save!
rescue StandardError
nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think the begin block is necessary here. Otherwise doesn't it always return nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, there might be a special syntax case for rescue without begin...

you can also do stuff like

def thang(args)
  # ... stuff that might raise exception
rescue ExceptionBit
  # ... yadda
end

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
Expand All @@ -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
Expand Down
Loading