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

Migrate CI from Travis CI to GitHub Actions #173

Merged
merged 7 commits into from
Apr 15, 2022

Conversation

mishina2228
Copy link
Contributor

@mishina2228 mishina2228 commented Apr 14, 2022

Close #170.

Problem

Since June 15th, 2021, the building on travis-ci.org is ceased.

Solution

This PR migrates CI from Travis CI to GitHub Actions.
Here are the details:

  • Add Ruby 3.0 and 3.1 to the CI matrix

    • rbx-2 is not included because ruby/setup-ruby does not support it.
  • Remove Coveralls

  • Address changes in RR v3.0.0

  • Require OpenStruct v0.3.3+

    • Some test cases failed when running CI in Ruby 3.0.
    Details
       1) Failure:
     Twurl::CLI::OptionParsingTest#test_setting_host_updates_to_requested_value [/home/runner/work/twurl/twurl/test/cli_test.rb:214]:
     Expected: "localhost:3000"
       Actual: "api.twitter.com"
    
       2) Failure:
     Twurl::CLI::OptionParsingTest#test_setting_proxy_updates_to_requested_value [/home/runner/work/twurl/twurl/test/cli_test.rb:237]:
     Expected: "localhost:80"
       Actual: nil
    
       3) Failure:
     Twurl::CLI::OptionParsingTest#test_passing_no_ssl_option_disables_ssl [/home/runner/work/twurl/twurl/test/cli_test.rb:196]:
     Expected false to be truthy.
    
       4) Failure:
     Twurl::CLI::OptionParsingTest#test_specifying_a_request_method_extracts_and_normalizes_request_method [/home/runner/work/twurl/twurl/test/cli_test.rb:54]:
     Expected: "put"
       Actual: "get"
    
       5) Failure:
     Twurl::CLI::OptionParsingTest#test_protocol_is_stripped_from_host [/home/runner/work/twurl/twurl/test/cli_test.rb:221]:
     Expected: "localhost:3000"
       Actual: "api.twitter.com"
    
       6) Failure:
     Twurl::CLI::OptionParsingTest#test_passing_data_and_an_explicit_request_method_uses_the_specified_method [/home/runner/work/twurl/twurl/test/cli_test.rb:148]:
     Expected: "delete"
       Actual: "post"
    
       7) Failure:
     Twurl::Options::Test#test_ssl_is_enabled_if_the_protocol_is_https [/home/runner/work/twurl/twurl/test/cli_options_test.rb:18]:
     Expected false to be truthy.
    
       8) Failure:
     Twurl::Options::Test#test_base_url_is_built_from_protocol_and_host [/home/runner/work/twurl/twurl/test/cli_options_test.rb:13]:
     Expected: "http://api.twitter.com"
       Actual: "https://api.twitter.com"
    
  • Drop support for Ruby 2.4

    • OpenStruct v0.3.3+ requires Ruby 2.5+.
    • Ruby 2.4 has already reached EOL on 2020-03-31.
      (Ruby 2.5 and 2.6 has reached EOL also, though)
  • Replace the CI status badge on README.md

The CI status can be checked here.

The following test cases fail when running CI in Ruby 3.0.

```
  1) Failure:
Twurl::CLI::OptionParsingTest#test_setting_host_updates_to_requested_value [/home/runner/work/twurl/twurl/test/cli_test.rb:214]:
Expected: "localhost:3000"
  Actual: "api.twitter.com"

  2) Failure:
Twurl::CLI::OptionParsingTest#test_setting_proxy_updates_to_requested_value [/home/runner/work/twurl/twurl/test/cli_test.rb:237]:
Expected: "localhost:80"
  Actual: nil

  3) Failure:
Twurl::CLI::OptionParsingTest#test_passing_no_ssl_option_disables_ssl [/home/runner/work/twurl/twurl/test/cli_test.rb:196]:
Expected false to be truthy.

  4) Failure:
Twurl::CLI::OptionParsingTest#test_specifying_a_request_method_extracts_and_normalizes_request_method [/home/runner/work/twurl/twurl/test/cli_test.rb:54]:
Expected: "put"
  Actual: "get"

  5) Failure:
Twurl::CLI::OptionParsingTest#test_protocol_is_stripped_from_host [/home/runner/work/twurl/twurl/test/cli_test.rb:221]:
Expected: "localhost:3000"
  Actual: "api.twitter.com"

  6) Failure:
Twurl::CLI::OptionParsingTest#test_passing_data_and_an_explicit_request_method_uses_the_specified_method [/home/runner/work/twurl/twurl/test/cli_test.rb:148]:
Expected: "delete"
  Actual: "post"

  7) Failure:
Twurl::Options::Test#test_ssl_is_enabled_if_the_protocol_is_https [/home/runner/work/twurl/twurl/test/cli_options_test.rb:18]:
Expected false to be truthy.

  8) Failure:
Twurl::Options::Test#test_base_url_is_built_from_protocol_and_host [/home/runner/work/twurl/twurl/test/cli_options_test.rb:13]:
Expected: "http://api.twitter.com"
  Actual: "https://api.twitter.com"
```

According to twitter#159 (comment),
the cause appears to be a bug in OpenStruct.
The bug was fixed in ruby/ostruct#23, and released as v0.3.3.
- OpenStruct v0.3.3+ requires Ruby 2.5+.
- It's already reached EOL on 2020-03-31.
@github-actions
Copy link

github-actions bot commented Apr 14, 2022

CLA Assistant Lite bot All Contributors have signed the CLA. If the commit check is not passing, a maintainer must go the Checks tab of this PR and rerun the GitHub Action.

@CLAassistant
Copy link

CLAassistant commented Apr 14, 2022

CLA assistant check
All committers have signed the CLA.

@mishina2228
Copy link
Contributor Author

mishina2228 commented Apr 14, 2022

recheck

@mishina2228
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@smaeda-ks smaeda-ks self-requested a review April 15, 2022 19:42
@smaeda-ks
Copy link
Collaborator

This looks good to me, thanks @mishina2228

@smaeda-ks smaeda-ks merged commit 3604e65 into twitter:master Apr 15, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2022
@mishina2228 mishina2228 deleted the migrate-to-gh-actions branch April 16, 2022 01:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

changes to continuous integration
3 participants