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

Use GitHub Actions for CI testing #178

Closed
wants to merge 15 commits into from
Closed
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
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # Monthly

env:
CHILDPROCESS_UNSET: should-be-unset

jobs:

test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', jruby-9.2]
posix_spawn: [true, false]
exclude:
# The action used seems to not fully support JRuby on Windows
Copy link
Contributor

@eregon eregon Jun 20, 2021

Choose a reason for hiding this comment

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

What's the issue? The seems to imply it's an issue of ruby/setup-ruby, but I don't know of any.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I think that that build combination just hung forever trying to even start up. No getting to the tests and failing just a lot of "why is this job still spinning and having no output after over an hour?". Although, now that I go back and look at the cancelled build in order to link it, it now has output. Still took me killing the process for that to happen, though.

https://github.com/enkessler/childprocess/runs/2755087269?check_suite_focus=true

Copy link
Contributor

Choose a reason for hiding this comment

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

That seems a bug of GitHub Actions then, nothing to with ruby/setup-ruby (which I guess is meant by The action).

Copy link
Owner Author

Choose a reason for hiding this comment

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

A bit odd that a GitHub Action bug would only appear for JRuby but not for the other flavors, given that they all use the same underlying action. That could be the case, though.

Regardless, I just chucked it into the "stuff that I'm not going to worry about right now" bucket because there was no obvious reason for it to not work, that action not necessarily working for JRuby+Windows is a known issue, and not having JRuby + Windows build combination wasn't any worse than our current CI situation. If you want to try throwing JRuby back into the mix and seeing what happens, feel free to do so.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's probably fine to ignore for now.
What I meant as a ruby/setup-ruby maintainer is I believe this issue has nothing to do with ruby/setup-ruby.
I guess it's either a bug of JRuby on Windows (e.g., the issue you linked), or of GitHub Actions.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Oh. In that case, yeah, you'd have a better idea than most what the problem might be. ;)

Hello famous person. waves

- os: windows-latest
ruby-version: jruby-9.2

runs-on: ${{ matrix.os }}
env:
CHILDPROCESS_POSIX_SPAWN: ${{ matrix.posix_spawn }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run Tests
run: bundle exec rake spec
- name: Push code coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: "./coverage/lcov/lcov.info"
parallel: true
flag-name: run-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ matrix.posix_spawn }}

test_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
15 changes: 15 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'simplecov-lcov'


SimpleCov::Formatter::LcovFormatter.config do |config|
config.report_with_single_file = true
config.lcov_file_name = 'lcov.info'
end

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::LcovFormatter])

SimpleCov.start do
root __dir__
merge_timeout 300
end
3 changes: 2 additions & 1 deletion childprocess.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ Gem::Specification.new do |s|

s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "yard", "~> 0.0"
s.add_development_dependency 'coveralls', '< 1.0'
s.add_development_dependency 'simplecov', '< 1.0'
s.add_development_dependency 'simplecov-lcov', '< 1.0'
end
5 changes: 1 addition & 4 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

unless defined?(JRUBY_VERSION)
require 'coveralls'
Coveralls.wear!
end
require 'simplecov'

require 'childprocess'
require 'rspec'
Expand Down