Skip to content

Commit

Permalink
chore: upgrade CI, RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jan 17, 2024
1 parent 9546d02 commit 705bbed
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 78 deletions.
73 changes: 7 additions & 66 deletions .github/workflows/docs-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,75 +7,16 @@ on:
paths:
- "*.md"
- "**/*.md"
- "gemfiles/rubocop.gemfile"
- "rubocop-md.yml"
- "rubocop.yml"
- ".mdlrc"
- "forspell.dict"
- ".github/workflows/docs-lint.yml"
pull_request:
paths:
- "*.md"
- "**/*.md"
- "gemfiles/rubocop.gemfile"
- "rubocop-md.yml"
- "rubocop.yml"
- ".mdlrc"
- "forspell.dict"
- ".github/workflows/docs-lint.yml"

jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Run Markdown linter
run: |
gem install mdl
mdl **/*.md
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Lint Markdown files with RuboCop
run: |
gem install bundler
bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3
bundle exec --gemfile gemfiles/rubocop.gemfile rubocop -c .rubocop-md.yml
forspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Hunspell
run: |
sudo apt-get install hunspell
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Cache installed gems
uses: actions/cache@v1
with:
path: /home/runner/.rubies/ruby-2.7.0/lib/ruby/gems/2.7.0
key: gems-cache-${{ runner.os }}
- name: Install Forspell
run: gem install forspell
- name: Run Forspell
run: forspell **/*.md *.md

lychee:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: docs README.md CHANGELOG.md -v
docs-lint:
uses: anycable/github-actions/.github/workflows/docs-lint.yml@master
with:
forspell-args: "*.md"
mdl-path: README.md CHANGELOG.md
9 changes: 5 additions & 4 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ on:
jobs:
rubocop:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: "gemfiles/rubocop.gemfile"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1
bundler-cache: true
- name: Lint Ruby code with RuboCop
run: |
gem install bundler
bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3
bundle exec --gemfile gemfiles/rubocop.gemfile rubocop
bundle exec rubocop
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
coverage: "false"
- ruby: "3.2"
gemfile: "gemfiles/rails7.gemfile"
coverage: "false"
- ruby: "3.3"
gemfile: "gemfiles/rails71.gemfile"
coverage: "true"
- ruby: "3.1"
gemfile: "gemfiles/railsmaster.gemfile"
Expand Down
3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ Naming/FileName:
Exclude:
- '**/*.md'

# FIXME: Enable back when Ruby Next 0.14 is released
Layout/SpaceAfterColon:
Style/ArgumentsForwarding:
Enabled: false
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018-2023 Vladimir Dementyev
Copyright (c) 2018-2024 Vladimir Dementyev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions action_policy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Gem::Specification.new do |spec|
# When gem is installed from source, we add `ruby-next` as a dependency
# to auto-transpile source files during the first load
if ENV["RELEASING_GEM"].nil? && File.directory?(File.join(__dir__, ".git"))
spec.add_runtime_dependency "ruby-next", ">= 0.14.0"
spec.add_runtime_dependency "ruby-next", ">= 1.0"
else
spec.add_dependency "ruby-next-core", ">= 0.14.0"
spec.add_dependency "ruby-next-core", ">= 1.0"
end

spec.add_development_dependency "ammeter", "~> 1.1.3"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails7.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

gem "sqlite3"
gem "rails", "~> 7.0"
gem "rails", "~> 7.0.0"
gem "method_source"
gem "unparser"

Expand Down
13 changes: 13 additions & 0 deletions gemfiles/rails71.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
source "https://rubygems.org"

gem "sqlite3"
gem "rails", "~> 7.1.0"
gem "method_source"
gem "unparser"

if ENV["COVERAGE"] == "true"
gem "simplecov"
gem "simplecov-lcov"
end

gemspec path: ".."
2 changes: 1 addition & 1 deletion gemfiles/rubocop.gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source "https://rubygems.org" do
gem "rubocop-md", "~> 1.0"
gem "standard", "~> 1.0"
gem "ruby-next", ">= 0.12.0"
gem "ruby-next", ">= 1.0"
end
2 changes: 1 addition & 1 deletion test/action_policy/rails/controllers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def index
private

def authorize!
super with: UserPolicy
super(with: UserPolicy)
end

def current_user
Expand Down

0 comments on commit 705bbed

Please sign in to comment.