Skip to content

Commit

Permalink
Merge pull request #23 from bdurand/regression_test
Browse files Browse the repository at this point in the history
Add regression test
  • Loading branch information
bdurand authored Nov 11, 2023
2 parents bce417c + f2ce264 commit 3986c23
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Run tests
name: Continuous Integration
on:
push:
branches:
- master
- actions-*
tags:
- v*
pull_request:
Expand All @@ -28,9 +29,11 @@ jobs:
- ruby: "2.6"
- ruby: "2.5"
- ruby: "2.4"
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
Expand All @@ -41,15 +44,16 @@ jobs:
gem uninstall bundler --all
gem install bundler --no-document --version ${{ matrix.bundler }}
- name: Set Appraisal bundle
if: matrix.appraisal != ''
if: matrix.appraisal != '' && matrix.gemfile == ''
run: |
echo "using gemfile gemfiles/${{ matrix.appraisal }}.gemfile"
bundle config set gemfile "gemfiles/${{ matrix.appraisal }}.gemfile"
cat gemfiles/${{ matrix.appraisal }}.gemfile
- name: Install bundle
run: |
bundle update
- name: Run specs
run: bundle exec rake spec
- name: Run standardrb
if: matrix.standardrb == true
run: bundle exec standardrb
run: bundle exec rake standard
29 changes: 29 additions & 0 deletions .github/workflows/regression_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Regression Test
on:
workflow_dispatch:
schedule:
- cron: "0 15 * * 1"
env:
BUNDLE_CLEAN: "true"
BUNDLE_PATH: vendor/bundle
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
jobs:
specs:
name: Run specs
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
- name: Install bundler
run: |
bundle update
- name: Run specs
run: |
bundle exec rake spec
3 changes: 0 additions & 3 deletions .standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ ruby_version: 2.4
format: progress

ignore:
- "**/*":
# Explicitly keep b/c these serve as documentation
- Style/IfWithBooleanLiteralBranches
- 'spec/**/*':
- Lint/UselessAssignment
9 changes: 5 additions & 4 deletions CHANGE_LOG.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.2] - 2023-04-04
## 1.0.2

### Changed

- Follow [RFC 4648](https://www.ietf.org/rfc/rfc4648.txt) base 64 encoding, removing line-feeds from the encoded data.

## [1.0.1] - 2020-06-01
## 1.0.1 (June 01, 2020)

### Fixed

- Fix missing documentation links

## [1.0.0] 2020-05-31
## v1.0.0 (May 31, 2020)

### Added

Expand Down
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
source "https://rubygems.org"

gemspec

gem "rake"
gem "climate_control"

gem "rspec", "~> 3.10"
gem "appraisal"
gem "standard", "~> 1.0"

gem "rspec", "~> 3.9"

gem "simplecov", require: false
gem "yard"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SecretKeys
# Secret Keys

[![specs](https://github.com/bdurand/secret_keys/workflows/Run%20tests/badge.svg)](https://github.com/bdurand/secret_keys/actions?query=branch%3Amaster)
[![code style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
Expand Down
20 changes: 19 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
begin
require "bundler/setup"
rescue LoadError
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
end

require "yard"
YARD::Rake::YardocTask.new(:yard)

require "bundler/gem_tasks"

task :release do
unless `git rev-parse --abbrev-ref HEAD`.chomp == "main"
warn "Gem can only be released from the main branch"
exit 1
end
end

require "rspec/core/rake_task"
require "standard/rake"

RSpec::Core::RakeTask.new(:spec)

task default: :spec

require "standard/rake"

task :console do
require File.join(__dir__, "lib/secret_keys")
require "irb"
Expand Down
2 changes: 1 addition & 1 deletion lib/secret_keys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def equal_encrypted_values?(value_1, value_2)
decrypt_val_1 = decrypt_value(value_1)
decrypt_val_2 = decrypt_value(value_2)
if decrypt_val_1 == decrypt_val_2
if value_1 == decrypt_val_1 || value_2 == decrypt_val_2
if value_1 == decrypt_val_1 || value_2 == decrypt_val_2 # rubocop:disable Style/IfWithBooleanLiteralBranches
false
else
true
Expand Down

0 comments on commit 3986c23

Please sign in to comment.