-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
- Loading branch information
1 parent
12a21df
commit 2ec5630
Showing
36 changed files
with
648 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "bundler" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'ruby' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: RSpec | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
rspec: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby 2.7.6 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.6 | ||
bundler-cache: true | ||
|
||
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: RuboCop run | ||
run: bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: RuboCop | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
rubocop: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby 2.7.6 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.6 | ||
bundler-cache: true | ||
|
||
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: RuboCop run | ||
run: | | ||
bash -c " | ||
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif | ||
[[ $? -ne 2 ]] | ||
" | ||
- name: Upload Sarif output | ||
uses: github/codeql-action/upload-sarif@v2 | ||
if: success() || failure() | ||
with: | ||
sarif_file: rubocop.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/.bundle/ | ||
/.yardoc | ||
/_yardoc/ | ||
/coverage/ | ||
/doc/ | ||
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
|
||
# Environment normalization: | ||
/.bundle/ | ||
/vendor/bundle | ||
/lib/bundler/man/ | ||
|
||
# rspec failure tracking | ||
.rspec_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--format documentation | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require: | ||
- rubocop-performance | ||
- rubocop-rake | ||
- rubocop-rspec | ||
|
||
AllCops: | ||
NewCops: enable | ||
TargetRubyVersion: 2.7.0 | ||
Exclude: | ||
- 'vendor/**/*' | ||
- '.git/**/*' | ||
|
||
Metrics/MethodLength: | ||
Max: 20 | ||
|
||
Naming/InclusiveLanguage: | ||
Enabled: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## [Unreleased] | ||
|
||
## [0.1.0] - 2023-02-22 | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in triggers_check.gemspec | ||
gemspec | ||
|
||
group :development do | ||
gem 'code-scanning-rubocop' | ||
gem 'rake' | ||
gem 'rspec' | ||
gem 'rubocop' | ||
gem 'rubocop-performance' | ||
gem 'rubocop-rake' | ||
gem 'rubocop-rspec' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
triggers_check (0.1.0) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
ast (2.4.2) | ||
code-scanning-rubocop (0.6.1) | ||
rubocop (~> 1.0) | ||
diff-lcs (1.5.0) | ||
json (2.6.3) | ||
parallel (1.22.1) | ||
parser (3.2.1.0) | ||
ast (~> 2.4.1) | ||
rainbow (3.1.1) | ||
rake (13.0.6) | ||
regexp_parser (2.7.0) | ||
rexml (3.2.5) | ||
rspec (3.12.0) | ||
rspec-core (~> 3.12.0) | ||
rspec-expectations (~> 3.12.0) | ||
rspec-mocks (~> 3.12.0) | ||
rspec-core (3.12.1) | ||
rspec-support (~> 3.12.0) | ||
rspec-expectations (3.12.2) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.12.0) | ||
rspec-mocks (3.12.3) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.12.0) | ||
rspec-support (3.12.0) | ||
rubocop (1.45.1) | ||
json (~> 2.3) | ||
parallel (~> 1.10) | ||
parser (>= 3.2.0.0) | ||
rainbow (>= 2.2.2, < 4.0) | ||
regexp_parser (>= 1.8, < 3.0) | ||
rexml (>= 3.2.5, < 4.0) | ||
rubocop-ast (>= 1.24.1, < 2.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (>= 2.4.0, < 3.0) | ||
rubocop-ast (1.26.0) | ||
parser (>= 3.2.1.0) | ||
rubocop-capybara (2.17.1) | ||
rubocop (~> 1.41) | ||
rubocop-performance (1.16.0) | ||
rubocop (>= 1.7.0, < 2.0) | ||
rubocop-ast (>= 0.4.0) | ||
rubocop-rake (0.6.0) | ||
rubocop (~> 1.0) | ||
rubocop-rspec (2.18.1) | ||
rubocop (~> 1.33) | ||
rubocop-capybara (~> 2.17) | ||
ruby-progressbar (1.11.0) | ||
unicode-display_width (2.4.2) | ||
|
||
PLATFORMS | ||
x86_64-linux | ||
|
||
DEPENDENCIES | ||
code-scanning-rubocop | ||
rake | ||
rspec | ||
rubocop | ||
rubocop-performance | ||
rubocop-rake | ||
rubocop-rspec | ||
triggers_check! | ||
|
||
BUNDLED WITH | ||
2.2.33 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# TriggersCheck | ||
|
||
The gem that provides the ability to check whether the testing process should be started | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
```ruby | ||
gem 'triggers_check' | ||
``` | ||
|
||
And then execute: | ||
|
||
$ bundle install | ||
|
||
Or install it yourself as: | ||
|
||
$ gem install triggers_check | ||
|
||
## Usage | ||
|
||
### Initialization options | ||
|
||
| Parameter | Descriptions | | ||
| --------- | ------------ | | ||
| :work_directory | The directory where the source code is located | ||
| :test_objects | The list of objects that are expected to run tests | ||
| :diff_file | The file with PR difference (default: #{work_directory}/diff.txt) | ||
| :triggers_file | The file with the list of includes/excludes for each test object (default: #{work_directory}/triggers.yml) | ||
| :logger | The ruby logger object for logging (default: disabled) | ||
|
||
### Examples | ||
|
||
See examples in corresponding directory | ||
|
||
## Development | ||
|
||
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. | ||
|
||
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). | ||
|
||
## Contributing | ||
|
||
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/triggers_check. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/gem_tasks' | ||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
require 'rubocop/rake_task' | ||
|
||
RuboCop::RakeTask.new | ||
|
||
task default: %i[spec rubocop] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/setup' | ||
require 'triggers_check' | ||
|
||
# You can add fixtures and/or initialization code here to make experimenting | ||
# with your gem easier. You can also use a different console, if you like. | ||
|
||
# (If you use this, don't forget to add pry to your Gemfile!) | ||
# require "pry" | ||
# Pry.start | ||
|
||
require 'irb' | ||
IRB.start(__FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/drv/a.cpp | ||
src/drv/b.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
require "logger" | ||
require 'triggers_check' | ||
logger = Logger.new(STDOUT) | ||
logger.level = Logger::DEBUG | ||
|
||
[ 'drv', 'driver' ].each do |object| | ||
checker = TriggersCheck::Checker.new('.', [ object ], logger: logger) | ||
puts "Test object: #{object} -> #{checker.trigger?}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"driver": | ||
include: | ||
- src/drv/ | ||
exclude: | ||
- src/drv/license | ||
"driver2": | ||
include: | ||
- src/drv2/ | ||
exclude: | ||
- src/drv2/srv/ | ||
- src/drv2/license | ||
"*": | ||
include: | ||
- / | ||
- src/tools/ | ||
exclude: | ||
- license |
Oops, something went wrong.