Skip to content

Commit

Permalink
Add Github Actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
blowmage committed Oct 31, 2023
1 parent ac2d8f2 commit 802d156
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Ruby CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: test

runs-on: ubuntu-latest
if: |
!( contains(github.event.pull_request.title, '[ci skip]')
|| contains(github.event.pull_request.title, '[skip ci]'))
strategy:
matrix:
ruby-version: ['3.2', '3.1', '3.0', '2.7']

steps:
- uses: actions/checkout@v4

- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Run tests
run: |
ruby -v
bundle -v
bundle exec rake test
rubocop:
name: rubocop

runs-on: ubuntu-latest
if: |
!( contains(github.event.pull_request.title, '[ci skip]')
|| contains(github.event.pull_request.title, '[skip ci]'))
steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Run Rubocop
run: |
ruby -v
bundle -v
bundle exec rubocop -v
bundle exec rubocop
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 2.7
Exclude:
- "doc/**/*"
- "pkg/**/*"
- "vendor/**/*"
- "minitest-rg.gemspec"
- "Rakefile"
- "Gemfile"
Expand Down

0 comments on commit 802d156

Please sign in to comment.