-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix: CI. #81
Fix: CI. #81
Changes from 1 commit
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 |
---|---|---|
@@ -1,39 +1,37 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
mongodb: ["4.4"] | ||
ruby: ["2.5", "2.6", "2.7", "3.0"] | ||
gemfile: | ||
- mongoid-3.1 | ||
- mongoid-4.0 | ||
- mongoid-5.0 | ||
- mongoid-6.0 | ||
- mongoid-7.0 | ||
- mongoid-8.0 | ||
|
||
entry: | ||
- { ruby: "2.6", mongodb: '4.4', gemfile: 'mongoid-4.0', bundler: '2.0.0.pre.3' } | ||
- { ruby: "2.7", mongodb: '4.4', gemfile: 'mongoid-5.0', bundler: '2.0.0.pre.3' } | ||
- { ruby: "2.7", mongodb: '4.4', gemfile: 'mongoid-6.0' } | ||
- { ruby: "2.7", mongodb: '4.4', gemfile: 'mongoid-7.0' } | ||
- { ruby: "3.1", mongodb: '4.4', gemfile: 'mongoid-8.0' } | ||
name: test (ruby=${{ matrix.entry.ruby }}, mongodb=${{ matrix.entry.mongodb }}), gemfile=${{ matrix.entry.gemfile }}) | ||
env: | ||
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile | ||
BUNDLE_GEMFILE: gemfiles/${{ matrix.entry.gemfile }}.gemfile | ||
steps: | ||
- name: Set up MongoDB ${{ matrix.mongodb }} | ||
- name: Set up MongoDB ${{ matrix.entry.mongodb }} | ||
uses: supercharge/mongodb-github-action@1.8.0 | ||
with: | ||
mongodb-version: ${{ matrix.mongodb }} | ||
# https://github.com/marketplace/actions/checkout | ||
mongodb-version: ${{ matrix.entry.mongodb }} | ||
- uses: actions/checkout@v2 | ||
# https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
ruby-version: ${{ matrix.entry.ruby }} | ||
- name: Bundle install w/custom bundler | ||
if: ${{ matrix.entry.bundler }} | ||
run: | | ||
gem install bundler:${{ matrix.entry.bundler }} | ||
bundle _${{ matrix.entry.bundler }}_ install | ||
- name: Bundle install with default bundler | ||
if: ${{ !matrix.entry.bundler }} | ||
run: bundle install | ||
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. [CONFUSED] For example: - name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: ${{ matrix.bundler }} Why the extra work here to specify the bundler version? Also, for older ruby versions, just specify bundler 1. 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. I cannot get the older rubies + rails to work with anything other than bundler 2.0.0.pre.3. So I chose the version recommended. That said, I think I can do Update: ruby-setup doesn't support 2.0.0.pre.3 format, but this works with the latest 1.x. ruby/setup-ruby#439 |
||
- name: Run tests | ||
run: bundle exec rake |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: PR Linter | ||
on: [pull_request] | ||
jobs: | ||
danger: | ||
runs-on: ubuntu-latest | ||
env: | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
- run: | | ||
# the personal token is public, this is ok, base64 encode to avoid tripping Github | ||
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode) | ||
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :test do | ||
gem 'mongoid-danger', '~> 0.2.0' | ||
end |
This file was deleted.
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.
[CONFUSED] I don't understand this refactor of the matrix. I'd rather see a traditional build matrix and possible
include
orexclude
keys for edge cases.i.e. This
entry
array doesn't make sense to me. What am I misunderstanding?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 find this a lot cleaner and more declarative because we benefit little from a matrix.