Skip to content

Commit

Permalink
remove active_attr, setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin committed Oct 30, 2023
1 parent d516f22 commit 70b8d57
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 4 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: ci

on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
gemfile: ['rails_7.0', 'rails_7.1']
ruby: [3.3, 3.2, 3.1]
include:
- gemfile: rails_7.0
ruby: '3.0'
- gemfile: rails_7.0
ruby: 2.7
- gemfile: rails_6.1
ruby: 2.7
- gemfile: rails_6.0
ruby: 2.7
- gemfile: rails_5.2
ruby: 2.7
- gemfile: rails_5.1
ruby: 2.7
- gemfile: rails_5.0
ruby: 2.7

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
CI: true
COVERALLS_REPO_TOKEN: izk0cvqAVqD2Vdews2UjsnOZHLgzocyQL
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: RSpec and Rubocop
run: |
bundle exec rubocop -c .rubocop.yml
bundle exec rspec
26 changes: 26 additions & 0 deletions .github/workflows/rubocop-challenger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "RuboCop Challenge"

on:
schedule:
- cron: '30 23 * * 2,3,4' # この設定の場合、火水木のAM8:30に自動でPRが作られます。

jobs:
create-pr:
name: Create Pull Request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.5
- name: Install bundler
run: gem install bundler
- name: Install gems
run: bundle install --jobs 4 --retry 3
- name: Set git configuration
run: git config remote.origin.url "[email protected]:payrollhero/webhook_system.git" # プロジェクトごとに変わる値です。
- name: Create RuboCop challenge pull request
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec rubocop_challenger go --exclude-limit=180 --base-branch=master [email protected] --name="Rubocop Challenger" --mode=random
1 change: 0 additions & 1 deletion lib/ph_model.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'active_support/all'
require 'active_model'
require 'active_attr'

ActiveModel::Validations # ensure its loaded since we're patching it

Expand Down
5 changes: 2 additions & 3 deletions ph_model.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
gem.authors = ['Piotr Banasik']
gem.email = '[email protected]'

gem.summary = 'ph-model -- active_model, active_attr brought together at last'
gem.summary = 'ph-model -- active_model, ??? active_attr brought together at last'
gem.description = 'Because why do less if you can do more with non db models'
gem.homepage = 'https://github.com/payrollhero/ph_model'
gem.license = 'MIT'
Expand All @@ -20,10 +20,9 @@ Gem::Specification.new do |gem|

gem.add_runtime_dependency 'activesupport', '> 3.2'
gem.add_runtime_dependency 'activemodel', '> 3.2'
gem.add_runtime_dependency 'active_attr', '~> 0.8'

gem.add_development_dependency 'faraday'
gem.add_development_dependency 'bundler', '~> 1.0'
gem.add_development_dependency 'bundler', '~> 2.3'
gem.add_development_dependency 'rake', '~> 10.0'
gem.add_development_dependency 'rspec', '~> 3.0'
gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
Expand Down

0 comments on commit 70b8d57

Please sign in to comment.