Skip to content

Commit

Permalink
Drop support for ended ruby versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kivanio committed Aug 7, 2023
1 parent 472079f commit bbf68a5
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 104 deletions.
63 changes: 32 additions & 31 deletions .github/workflows/brakeman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ name: Brakeman Scan

on:
push:
branches: [ "master" ]
branches: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '28 13 * * 4'
branches: ['master']
# schedule:
# - cron: '28 13 * * 4'

permissions:
contents: read
Expand All @@ -29,30 +29,31 @@ jobs:
name: Brakeman Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3

# Customize the ruby version depending on your needs
- name: Setup Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: '2.7'

- name: Setup Brakeman
env:
BRAKEMAN_VERSION: '4.10' # SARIF support is provided in Brakeman version 4.10+
run: |
gem install brakeman --version $BRAKEMAN_VERSION
# Execute Brakeman CLI and generate a SARIF output with the security issues identified during the analysis
- name: Scan
continue-on-error: true
run: |
brakeman -f sarif -o output.sarif.json .
# Upload the SARIF file generated in the previous step
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: output.sarif.json
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3

# Customize the ruby version depending on your needs
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true

- name: Setup Brakeman
env:
BRAKEMAN_VERSION: '4.10' # SARIF support is provided in Brakeman version 4.10+
run: |
gem install brakeman --version $BRAKEMAN_VERSION
# Execute Brakeman CLI and generate a SARIF output with the security issues identified during the analysis
- name: Scan
continue-on-error: true
run: |
brakeman -f sarif -o output.sarif.json .
# Upload the SARIF file generated in the previous step
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: output.sarif.json
67 changes: 33 additions & 34 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ "master" ]
branches: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '41 19 * * 4'
branches: ['master']
# schedule:
# - cron: '41 19 * * 4'

jobs:
analyze:
Expand All @@ -33,45 +33,44 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'ruby' ]
language: ['ruby']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

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

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# 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

# ℹ️ 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.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{matrix.language}}'
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: linters
on:
push:
branches: [master]
pull_request:
pull_request: ['master']
jobs:
lint:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: Test against Ruby ${{ matrix.ruby-version }}
strategy:
matrix:
ruby-version: [2.6, 2.7, 3.0, 3.1, 3.2]
ruby-version: [2.7, 3.0, 3.1, 3.2]

steps:
- uses: actions/checkout@v3
Expand Down
66 changes: 33 additions & 33 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
# documentation.

# pulled from repo
name: "Rubocop"
name: 'Rubocop'

on:
push:
branches: [ "master" ]
branches: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '33 3 * * 6'
branches: ['master']
# schedule:
# - cron: '33 3 * * 6'

jobs:
rubocop:
Expand All @@ -22,31 +22,31 @@ jobs:
fail-fast: false

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

# If running on a self-hosted runner, check it meets the requirements
# listed at https://github.com/ruby/setup-ruby#using-self-hosted-runners
- name: Set up Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: 2.6

# This step is not necessary if you add the gem to your Gemfile
- name: Install Code Scanning integration
run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install

- 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
with:
sarif_file: rubocop.sarif
- name: Checkout repository
uses: actions/checkout@v3

# If running on a self-hosted runner, check it meets the requirements
# listed at https://github.com/ruby/setup-ruby#using-self-hosted-runners
- name: Set up Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: 2.6

# This step is not necessary if you add the gem to your Gemfile
- name: Install Code Scanning integration
run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install

- 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
with:
sarif_file: rubocop.sarif
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
SuggestExtensions: false

Style/FrozenStringLiteralComment:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.2.2
2 changes: 1 addition & 1 deletion brcobranca.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
gem.homepage = 'http://rubygems.org/gems/brcobranca'
gem.files = Dir['Rakefile', '{lib}/**/*', 'README*', 'LICENSE*', 'CHANGELOG*', 'History*']
gem.require_paths = ['lib']
gem.required_ruby_version = '>= 2.6.0'
gem.required_ruby_version = '>= 2.7.0'

gem.requirements = ['GhostScript > 9.0, para gerar PDF e código de Barras']

Expand Down
2 changes: 1 addition & 1 deletion spec/brcobranca/rghost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
s = `#{RGhost::Config::GS[:path]} -v`
expect(s).to match(/^GPL Ghostscript/)
s = `#{RGhost::Config::GS[:path]} --version`
expect(s).to match(/[8-9]\.[0-9]/)
expect(s).to match(/[8-9]\.[0-9]|[1-9][0-9]*\.[0-9]+\.[0-9]+/)
end
end

0 comments on commit bbf68a5

Please sign in to comment.