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

Drop Support Ruby 3.0 #217

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
152 changes: 0 additions & 152 deletions .circleci/config.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "Github Pages"

on:
push:
branches:
- main
tags:
- v*

jobs:
pages:
name: Github Pages
runs-on: ubuntu-latest
env:
api-dir: ./

strategy:
fail-fast: false

steps:
- name: Checkout repository for Yard
uses: actions/checkout@v3
with:
path: discordrb_docs

- name: Install OS package
run: |
sudo apt update
sudo apt install -y git openssh-client

- name: Setup Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: Checkout repository for Github Pages
uses: actions/checkout@v3
with:
path: discordrb_gh
ref: gh-pages

- name: Run bundle install
working-directory: ${{env.api-dir}}
run: |
gem install bundler
BUNDLE_GEMFILE=discordrb_docs/Gemfile bundle install --jobs 4 --retry 3

- name: Generate Yard docs
working-directory: ${{env.api-dir}}
run: |
cd discordrb_docs
bundle exec yard --output-dir /tmp/docs

- name: Commit & Push docs
run: |
cd discordrb_gh
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
mkdir -p $GITHUB_REF_NAME
rm -rf $GITHUB_REF_NAME/*
cp -r /tmp/docs/. $GITHUB_REF_NAME
git add $GITHUB_REF_NAME
git commit --allow-empty -m "[skip ci] Deploy docs"
git push
53 changes: 53 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "RSpec"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
rspec:
name: RSpec
runs-on: ubuntu-latest
env:
api-dir: ./

strategy:
fail-fast: false
matrix:
versions: [ '3.1', '3.2', '3.3' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup libraries
run: |
sudo apt update
sudo apt install -y libsodium-dev

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

- name: Run bundle install (Ruby ${{ matrix.versions }})
working-directory: ${{env.api-dir}}
run: |
gem install bundler
bundle install --jobs 4 --retry 3

- name: RSpec spec (Ruby ${{ matrix.versions }})
working-directory: ${{env.api-dir}}
run: bundle exec rspec spec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml

- name: Save test results (Ruby ${{ matrix.versions }})
uses: actions/upload-artifact@v3
with:
name: rspec_results_${{ matrix.versions }}
path: ~/rspec/rspec.xml
retention-days: 30
39 changes: 39 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "RuboCop"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
rubocop:
name: RuboCop
runs-on: ubuntu-latest
env:
api-dir: ./

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: Run bundle install
working-directory: ${{env.api-dir}}
run: |
gem install bundler
bundle install --jobs 4 --retry 3

- name: RuboCop checks
working-directory: ${{env.api-dir}}
run: bundle exec rubocop
51 changes: 51 additions & 0 deletions .github/workflows/yard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Yard"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
yard:
name: Yard
runs-on: ubuntu-latest
env:
api-dir: ./

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: Run bundle install
working-directory: ${{env.api-dir}}
run: |
gem install bundler
bundle install --jobs 4 --retry 3

- name: Generate Yard docs
working-directory: ${{env.api-dir}}
run: bundle exec yard --output-dir /tmp/docs

- name: Compress docs to prevent error 429
run: |
cd /tmp/docs
tar -cvf /tmp/docs.tar .

- name: Keep temporary the generated docs
uses: actions/upload-artifact@v3
with:
name: docs_${{ github.run_number }}
path: /tmp/docs.tar
retention-days: 30
16 changes: 15 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inherit_mode:

AllCops:
NewCops: enable
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1

# Disable line length checks
Layout/LineLength:
Expand Down Expand Up @@ -66,3 +66,17 @@ Style/SingleLineBlockParams:
Methods:
- reduce: [m, e]
- inject: [m, e]

# Rule to keep development dependencies inside gemspec file
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec

# Rule disabled to avoid breaking methods or behaviors unnecessarily (Reactivate if you find it relevant)
Style/ReturnNilInPredicateMethodDefinition:
Enabled: false
Style/HashSyntax:
Enabled: false
Naming/BlockForwarding:
Enabled: false
Style/ArgumentsForwarding:
Enabled: false
Loading
Loading