Skip to content

Commit

Permalink
Redis matrix test, dependabot, codeql, and redis upgrade (#205)
Browse files Browse the repository at this point in the history
* Redis matrix on ci

* Adding codeql

* Adding dependabot

* Test latest redis versions first

* Split codeql into separate job, test earlier redis versions

* Only test redis >= 4

* Bump redis requirement

* Require mfa on rubygems

* Changelog update
  • Loading branch information
iloveitaly committed Aug 13, 2022
1 parent 640bc92 commit a692a78
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "weekly"
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ jobs:

strategy:
matrix:
redis-version:
- 4.0
- 4.1
- 4.2
- 4.3
- 4.4
- 4.5
- 4.6
- latest
ruby-version:
- head
- '3.1'
Expand All @@ -29,6 +38,8 @@ jobs:
--health-retries 5
ports:
- 6379:6379
env:
REDIS_VERSION: "${{ matrix.redis-version }}"

steps:
- uses: actions/checkout@v2
Expand All @@ -37,5 +48,6 @@ jobs:
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # 'bundle install' and cache

- name: Run tests
run: bundle exec rake
62 changes: 62 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

name: "Code Scanning - Action"

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest

permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ If the Autobuild fails above, remove it and uncomment the following
# three lines and modify them (or add more) to build your code if your
# project uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Accept Proc as a namespace (#203)
- Fix deprecation warning of Redis.current (#189)
- Add support for getex
- Require Redis >= 4
- Added matrix tests on CI for supported redis versions

## 1.8.2

Expand Down
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
source "https://rubygems.org"

case redis_version = ENV.fetch('REDIS_VERSION', 'latest')
when 'latest'
gem 'redis', '~> 4'
else
gem 'redis', "~> #{redis_version}"
end

platforms :rbx do
# These are the ruby standard library
# dependencies of redis-rb, rake, and rspec.
Expand Down
15 changes: 8 additions & 7 deletions redis-namespace.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ Gem::Specification.new do |s|
s.date = Time.now.strftime('%Y-%m-%d')
s.summary = "Namespaces Redis commands."
s.homepage = "https://github.com/resque/redis-namespace"
s.email = ["chris@ozmm.org", "hone02@gmail.com", "steve@steveklabnik.com", "me@yaauie.com"]
s.authors = ["Chris Wanstrath", "Terence Lee", "Steve Klabnik", "Ryan Biesemeyer"]
s.email = ["chris@ozmm.org", "hone02@gmail.com", "steve@steveklabnik.com", "me@yaauie.com", "mike@mikebian.co"]
s.authors = ["Chris Wanstrath", "Terence Lee", "Steve Klabnik", "Ryan Biesemeyer", "Mike Bianco"]
s.license = 'MIT'

s.metadata = {
"bug_tracker_uri" => "https://github.com/resque/redis-namespace/issues",
"changelog_uri" => "https://github.com/resque/redis-namespace/blob/master/CHANGELOG.md",
"documentation_uri" => "https://www.rubydoc.info/gems/redis-namespace/#{s.version}",
"source_code_uri" => "https://github.com/resque/redis-namespace/tree/v#{s.version}",
"bug_tracker_uri" => "https://github.com/resque/redis-namespace/issues",
"changelog_uri" => "https://github.com/resque/redis-namespace/blob/master/CHANGELOG.md",
"documentation_uri" => "https://www.rubydoc.info/gems/redis-namespace/#{s.version}",
"source_code_uri" => "https://github.com/resque/redis-namespace/tree/v#{s.version}",
"rubygems_mfa_required" => "true"
}

s.files = %w( README.md Rakefile LICENSE )
Expand All @@ -26,7 +27,7 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 2.4'

s.add_dependency "redis", ">= 3.0.4"
s.add_dependency "redis", ">= 4"

s.add_development_dependency "rake"
s.add_development_dependency "rspec", "~> 3.7"
Expand Down

0 comments on commit a692a78

Please sign in to comment.