-
Notifications
You must be signed in to change notification settings - Fork 332
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
Add GitHub Actions CI #406
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Json | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
pass: | ||
name: >- | ||
pass ${{ matrix.os }} ${{ matrix.ruby }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu, macos, windows ] | ||
ruby: [ head, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, truffleruby ] | ||
include: | ||
- { os: windows, ruby: mingw } | ||
- { os: windows, ruby: mswin } | ||
exclude: | ||
- { os: windows, ruby: head } | ||
- { os: windows, ruby: truffleruby } | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: MSP-Greg/setup-ruby-pkgs@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove the your actions? The maintainers can't control it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's needed to install |
||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
apt-get: ragel | ||
brew: ragel | ||
mingw: _upgrade_ ragel | ||
|
||
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: Compile | ||
run: rake compile | ||
|
||
- name: Test | ||
run: rake test | ||
|
||
fail: | ||
name: >- | ||
fail ${{ matrix.os }} ${{ matrix.ruby }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu, macos ] | ||
ruby: [ jruby-head, jruby ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: MSP-Greg/setup-ruby-pkgs@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
apt-get: ragel | ||
brew: ragel | ||
|
||
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: Compile | ||
run: rake compile | ||
|
||
- name: Test | ||
continue-on-error: true | ||
run: rake test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not mix Linux/macOS and Windows platforms in the one workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious, why do you prefer separate workflows?
I usually prefer like this if there isn't much OS-specific logic, as it avoids duplication and makes it significantly easier to maintain (1 place to change vs 3).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The maintainability is low about mixing *nix and Windows for my experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That may have been true in the past at the beginning of GitHub Actions, but I don't think it's the case anymore, especially with improvements in ruby/setup-ruby. In fact many gems already use such an approach and in my experience, it's successful.
From a maintainability point of view it certainly looks better to me to have the steps repeated the minimum number of times (2 times here for allowed failures, instead of 3-4 if we have one job definition per OS).