Skip to content

Commit c4eef97

Browse files
committed
Updates verify workflow to use shared pipeline
1 parent 042e4ed commit c4eef97

File tree

4 files changed

+24
-69
lines changed

4 files changed

+24
-69
lines changed

.github/workflows/verify.yml

Lines changed: 10 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -25,70 +25,13 @@ on:
2525
- '*'
2626

2727
jobs:
28-
test:
29-
runs-on: ${{ matrix.os }}
30-
timeout-minutes: 40
31-
32-
services:
33-
postgres:
34-
image: postgres:9.6
35-
ports: ["5432:5432"]
36-
env:
37-
POSTGRES_USER: postgres
38-
POSTGRES_PASSWORD: postgres
39-
options: >-
40-
--health-cmd pg_isready
41-
--health-interval 10s
42-
--health-timeout 5s
43-
--health-retries 5
44-
45-
strategy:
46-
fail-fast: true
47-
matrix:
48-
ruby:
49-
- '2.7'
50-
- '3.0'
51-
- '3.1'
52-
- '3.2'
53-
os:
54-
- ubuntu-22.04
55-
- ubuntu-latest
56-
exclude:
57-
- { os: ubuntu-latest, ruby: '2.7' }
58-
- { os: ubuntu-latest, ruby: '3.0' }
59-
60-
env:
61-
RAILS_ENV: test
62-
63-
name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
64-
steps:
65-
- name: Install system dependencies
66-
run: sudo apt-get install libpcap-dev graphviz
67-
68-
- name: Checkout code
69-
uses: actions/checkout@v2
70-
71-
- name: Setup Ruby
72-
uses: ruby/setup-ruby@v1
73-
with:
74-
ruby-version: '${{ matrix.ruby }}'
75-
bundler-cache: true
76-
77-
- name: Test
78-
run: |
79-
cp spec/dummy/config/database.yml.github_actions spec/dummy/config/database.yml
80-
bundle exec rake --version
81-
bundle exec rake db:create db:migrate
82-
83-
# Disabling this check because it is proving unreliable
84-
# git diff --exit-code spec/dummy/db/structure.sql
85-
bundle exec rake spec
86-
bundle exec rake yard
87-
88-
- name: Upload coverage report
89-
uses: actions/upload-artifact@v4
90-
with:
91-
name: coverage-${{ matrix.os }}-${{ matrix.ruby }}
92-
path: |
93-
coverage/
94-
retention-days: 1
28+
build:
29+
uses: rapid7/metasploit-framework/.github/workflows/shared_gem_verify_rails.yml@master
30+
with:
31+
dependencies: '["libpcap-dev", "graphviz"]'
32+
test_commands: |
33+
cp spec/dummy/config/database.yml.github_actions spec/dummy/config/database.yml
34+
bundle exec rake --version
35+
bundle exec rake db:create db:migrate
36+
bundle exec rake spec
37+
bundle exec rake yard

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require 'bundler/gem_tasks'
22
require 'bundler/setup'
3+
require 'yard'
34

45
begin
56
require 'rdoc/task'

metasploit-credential.gemspec

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,16 @@ Gem::Specification.new do |s|
3838
s.add_runtime_dependency 'net-ssh'
3939

4040
s.add_runtime_dependency 'pg'
41+
42+
# mutex_m and bigdecimal are not part of the default gems starting from Ruby 3.4.0: https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/
43+
%w[
44+
bigdecimal
45+
csv
46+
drb
47+
mutex_m
48+
].each do |library|
49+
s.add_runtime_dependency library
50+
end
51+
4152
s.platform = Gem::Platform::RUBY
4253
end

yard/templates/default/module/html/setup.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def namespace_domain_models
9191
Metasploit::Credential::Engine.instance.eager_load!
9292

9393
ApplicationRecord.descendants.select { |klass|
94-
klass.parents.any? { |parent|
95-
parent.name == object.title
94+
klass.ancestors.any? { |ancestor|
95+
ancestor.name == object.title
9696
}
9797
}
9898
end

0 commit comments

Comments
 (0)