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

Run test on various Ruby versions #66

Merged
merged 4 commits into from
Nov 5, 2022
Merged
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
45 changes: 41 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
name: Test
on: [push]
jobs:
unit-test:
test:
runs-on: macOS-12
strategy:
fail-fast: false
matrix:
ruby-version:
- 2.7.5
- 3.0.4
- 3.1.2
steps:
- uses: actions/checkout@v3
- run: bundle install
- uses: paambaati/[email protected]
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Install cc-test-reporter
run: |
curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64
chmod +x cc-test-reporter
- run: ./cc-test-reporter before-build
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- run: bundle exec rake
- name: Format coverage
run: |
# Workaround for https://github.com/codeclimate/test-reporter/issues/495
jq 'map_values(. | map_values(if type=="object" then map_values(.lines) else . end))' coverage/.resultset.json > coverage/workaround.resultset.json
./cc-test-reporter format-coverage --input-type simplecov --output 'codeclimate-${{ matrix.ruby-version }}.json' coverage/workaround.resultset.json
- uses: actions/upload-artifact@v3
with:
name: coverages
path: codeclimate-${{ matrix.ruby-version }}.json
upload-coverage:
runs-on: ubuntu-20.04
needs: test
steps:
- uses: actions/download-artifact@v3
with:
coverageCommand: bundle exec rake
name: coverages
- name: Install cc-test-reporter
run: |
curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x cc-test-reporter
- name: Upload coverage
run: ./cc-test-reporter sum-coverage --output - codeclimate-*.json | ./cc-test-reporter upload-coverage --debug --input -
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ require:
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
NewCops: enable
2 changes: 1 addition & 1 deletion danger-periphery.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.summary = spec.description
spec.homepage = 'https://github.com/manicmaniac/danger-periphery'
spec.license = 'MIT'
spec.required_ruby_version = '>= 2.6.0'
spec.required_ruby_version = '>= 2.7.0'
spec.metadata['rubygems_mfa_required'] = 'true'

spec.files = Dir['lib/**/*.rb']
Expand Down