rapid7 / recog

Pattern recognition for hosts, services, and content
Other
662 stars 195 forks source link

Add Github Actions CI workflow #328

Closed gschneider-r7 closed 3 years ago

gschneider-r7 commented 3 years ago

Description

This PR adds a Github Actions CI workflow configuration to run tests automatically. I have configured the same Ruby versions used in the existing travis-ci config and added newer ones as well. Note: the jruby version used on travis-ci is not available for this GHA workflow, so a newer version was selected along with latest released jruby.

Additionally an invalid example was fixed to get tests to pass.

Note that the new workflow will begin running immediately when this PR is merged.

Motivation and Context

travis-ci has migrated open source repos from their .org platform to their .com platform, which now includes a limited number of worker credits. Currently, the R7 org has exhausted available worker credits and the UI doesn't indicate when they will be replenished. As such, tests on this repo are not currently being run for pull requests! This PR allows Github Actions to run the same tests in the interim or even long-term.

How Has This Been Tested?

Using my fork I tested that the workflow behaves as expected. You can see results here:

Top-level Actions results: https://github.com/gschneider-r7/recog/actions The passing workflow: https://github.com/gschneider-r7/recog/actions/runs/483919285 Example pull request: https://github.com/gschneider-r7/recog/pull/1

Note that for the PR example, it ran tests twice for push (commit) and pull request because I did not limit branches for testing. For fork-based PRs, only the pull request triggered events will appear (so half of the checks you see in that PR).

Types of changes

Checklist:

tsellers-r7 commented 3 years ago

Looks good, let's see how it goes. Thanks @gschneider-r7