diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 5572183c..4c6b101e 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -5,31 +5,51 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - ruby-version: [2.5, 2.6, 2.7] + ruby-version: [2.5, 2.6, 2.7, 3.0.4, 3.1] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: Set up Ruby - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} - name: Update Env run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV - name: Install Bundler run: gem install bundler -v '> 2' + - name: Remove Gemfile.lock + run: rm Gemfile.lock - name: Install dependencies run: bundle install - - name: Gem Install Origen + + # Work around Ruby 3 gem install issue + - name: Build Origen Gem - Ruby 3 work around + if: matrix.ruby-version == '3.0.4' || matrix.ruby-version == '3.1' + run: gem build origen.gemspec --output origen.gem + - name: Gem Install Origen - Ruby 3 work around + if: matrix.ruby-version == '3.0.4' || matrix.ruby-version == '3.1' + run: gem install origen.gem + + # Normal way of installing origen + - name: Gem Install Origen Ruby 2 + if: matrix.ruby-version == '2.5' || matrix.ruby-version == '2.6' || matrix.ruby-version == '2.7' run: gem install origen + - name: Setup Dependencies run: origen -v + + # Rubocop 0.30.0 is not compatible with Ruby 3.1 - name: Run Origen Lint + if: matrix.ruby-version == '2.5' || matrix.ruby-version == '2.6' || matrix.ruby-version == '2.7' || matrix.ruby-version == '3.0.4' run: origen lint --no-correct - name: Set Origen to debug mode run: origen m debug - name: Run Spec tests run: origen test -c + + # Temporarily disable web compile check in windows - name: Verify Building website + if: matrix.os == 'ubuntu-latest' run: origen web compile --no-serve diff --git a/Gemfile b/Gemfile index 0002a521..7942198d 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,8 @@ gem "loco" #gem "origen_testers", "~> 0.7" gem 'origen_debuggers', '~> 0' gem 'ripper-tags' -gem 'nokogiri', '1.10.10' # Lock to this version to enable testing in Ruby 2.2 +# gem 'nokogiri', '1.10.10' # Lock to this version to enable testing in Ruby 2.2 +gem 'nokogiri' # Plugins that provide guide pages gem "origen_testers", git: "https://github.com/Origen-SDK/origen_testers.git" diff --git a/Gemfile.lock b/Gemfile.lock index 4fdef7eb..eda3a30a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,11 +24,12 @@ GIT GIT remote: https://github.com/Origen-SDK/origen_testers.git - revision: 27537eb1bcc39b6995bc28c4f2ead4187e26c7b9 + revision: 48cd797b5003cebe02bbae6175a1e3ca9bb6aa1f specs: - origen_testers (0.48.2) + origen_testers (0.49.4) ast (~> 2) atp (~> 1.1, >= 1.1.3) + dentaku (~> 3) origen (>= 0.57.1) origen_stil (>= 0.2.1) require_all (~> 1) @@ -47,7 +48,6 @@ PATH colored (~> 1.2) colorize (~> 0.8.1) concurrent-ruby - cri (~> 2.10.0) dentaku (~> 3) gems (~> 0.8) highline (~> 1.7) @@ -55,7 +55,7 @@ PATH kramdown (~> 1.5) nanoc (~> 3.7.0) net-ldap (~> 0.13) - nokogiri (>= 1.7.2) + nokogiri (>= 1.11.0) pry (~> 0.10) rake (~> 10) rspec (~> 3) @@ -75,7 +75,7 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - ast (2.4.1) + ast (2.4.2) astrolabe (1.3.1) parser (~> 2.2) atp (1.1.3) @@ -87,53 +87,50 @@ GEM coderay (1.1.3) colored (1.2) colorize (0.8.1) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) coveralls (0.7.1) multi_json (~> 1.3) rest-client simplecov (>= 0.7) term-ansicolor thor - cri (2.10.1) - colored (~> 1.2) - dentaku (3.4.2) + cri (2.15.11) + dentaku (3.5.0) concurrent-ruby - diff-lcs (1.4.4) - docile (1.3.5) + diff-lcs (1.5.0) + docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dry-inflector (0.2.0) gems (0.8.3) highline (1.7.10) http-accept (1.7.0) - http-cookie (1.0.3) + http-cookie (1.0.4) domain_name (~> 0.5) httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) i18n (0.9.5) concurrent-ruby (~> 1.0) - json (2.5.1) + json (2.6.1) kramdown (1.17.0) loco (0.0.7) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.1104) - mini_portile2 (2.4.0) - minitest (5.14.4) + mime-types-data (3.2022.0105) + minitest (5.15.0) multi_json (1.15.0) multi_xml (0.6.0) nanoc (3.7.5) cri (~> 2.3) net-ldap (0.17.0) netrc (0.11.0) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) + nokogiri (1.13.4-x86_64-linux) + racc (~> 1.4) origen_debuggers (0.6.1) origen (>= 0.2.6) origen_testers (>= 0.5.0) - origen_doc_helpers (0.8.3) + origen_doc_helpers (0.8.6) origen (>= 0.7.15) origen_jtag (0.22.1) origen (~> 0.7, >= 0.7.35) @@ -153,6 +150,7 @@ GEM pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) + racc (1.6.0) rainbow (2.2.2) rake rake (10.5.0) @@ -163,25 +161,24 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) ripper-tags (0.9.0) - rodf (1.1.1) + rodf (1.2.0) builder (>= 3.0) - dry-inflector (~> 0.1) rubyzip (>= 1.0) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) + rspec-support (~> 3.11.0) rspec-legacy_formatters (1.0.2) rspec (~> 3.0) - rspec-mocks (3.10.2) + rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.3) + rspec-support (~> 3.11.0) + rspec-support (3.11.0) rubocop (0.30.0) astrolabe (~> 1.3) parser (>= 2.2.0.1, < 3.0) @@ -189,9 +186,9 @@ GEM rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.4) ruby-progressbar (1.11.0) - rubyzip (2.3.0) + rubyzip (2.3.2) scrub_rb (1.0.1) - sexpistol (0.0.7) + sexpistol (0.1.2) simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) @@ -202,7 +199,7 @@ GEM tins (~> 1.0) thor (0.20.3) thread_safe (0.3.6) - tins (1.26.0) + tins (1.31.0) sync treetop (1.6.11) polyglot (~> 0.3) @@ -210,17 +207,19 @@ GEM thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.7.7) - yard (0.9.26) + unf_ext (0.0.8.1) + webrick (1.7.0) + yard (0.9.27) + webrick (~> 1.7.0) PLATFORMS - ruby + x86_64-linux DEPENDENCIES byebug (~> 10) coveralls loco - nokogiri (= 1.10.10) + nokogiri origen! origen_app_generators! origen_core_support! @@ -232,4 +231,4 @@ DEPENDENCIES ripper-tags BUNDLED WITH - 2.1.4 + 2.3.7 diff --git a/lib/origen/pins.rb b/lib/origen/pins.rb index 3a416648..fe17ea7a 100755 --- a/lib/origen/pins.rb +++ b/lib/origen/pins.rb @@ -693,7 +693,13 @@ def virtual_pin_groups(id = nil, options = {}, &_block) end alias_method :virtual_pin_group, :virtual_pin_groups - def all_pin_ids(type: nil, **options) + def all_pin_ids(*options) + type = nil + if options.first.is_a?(Hash) + options = options.first + type = options[:type] + end + case type when :power_pin, :power_pins dut.pins(power_pin: true).map { |n, p| [n, *p.aliases.keys] }.flatten.map { |n| [n, dut.power_pin(n)] }.to_h diff --git a/lib/origen/pins/pin.rb b/lib/origen/pins/pin.rb index 42925b0c..19923a56 100755 --- a/lib/origen/pins/pin.rb +++ b/lib/origen/pins/pin.rb @@ -1090,11 +1090,12 @@ def ext_pulldown=(value) end end - def index?(context: nil) - !!index(context: context).nil? + def index?(options = { context: nil }) + !!index(options).nil? end - def index(context: nil) + def index(options = { context: nil }) + context = options[:context] if context.is_a?(Symbol) # Context pin group provided group = groups[context].instance_variable_get(:@store) @@ -1114,7 +1115,8 @@ def index(context: nil) end end - def mask(context: nil) + def mask(options = { context: nil }) + context = options[:context] index = context.is_a?(Integer) ? context : self.index(context: context) if index.nil? && context.nil? @@ -1130,7 +1132,10 @@ def mask(context: nil) alias_method :set_mask, :mask alias_method :smask, :mask - def clear_mask(context: nil, size: nil) + def clear_mask(options = { context: nil, size: nil }) + context = options[:context] + size = options[:size] + index = context.is_a?(Integer) ? context : self.index(context: context) if index.nil? && context.nil? diff --git a/lib/origen/version_string.rb b/lib/origen/version_string.rb index 0085a6f5..5e7780c7 100755 --- a/lib/origen/version_string.rb +++ b/lib/origen/version_string.rb @@ -186,7 +186,7 @@ def pre alias_method :dev, :pre def latest? - downcase.orig_equal?('trunk') || downcase.orig_equal?('latest') + downcase.to_s.eql?('trunk') || downcase.to_s.eql?('latest') end # Returns true if the version is a timestamp format version number diff --git a/origen.gemspec b/origen.gemspec index 7970f4e7..9337a385 100644 --- a/origen.gemspec +++ b/origen.gemspec @@ -37,8 +37,9 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "rspec-legacy_formatters", "~>1" spec.add_runtime_dependency "thor", "~>0.19" spec.add_runtime_dependency "nanoc", "~>3.7.0" - spec.add_runtime_dependency "kramdown", "~>1.5" + spec.add_runtime_dependency "kramdown", "~>2.4" spec.add_runtime_dependency "rubocop", "0.30" + # spec.add_runtime_dependency "rubocop" spec.add_runtime_dependency "coderay", "~>1.1" spec.add_runtime_dependency "rake", "~>10" spec.add_runtime_dependency "pry", "~>0.10" @@ -50,7 +51,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "highline", "~>1.7" spec.add_runtime_dependency "dentaku", "~>3" spec.add_runtime_dependency "colorize", "~> 0.8.1" - spec.add_runtime_dependency 'nokogiri', '>= 1.7.2' - spec.add_runtime_dependency 'cri', '~>2.10.0' # Not required by Origen, but add constrain to avoid Ruby 2.3 requirement + spec.add_runtime_dependency 'nokogiri', '>= 1.11.0' + #spec.add_runtime_dependency 'cri', '~>2.10.0' # Not required by Origen, but add constrain to avoid Ruby 2.3 requirement spec.add_runtime_dependency 'concurrent-ruby' end