diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42f3e975..85b9881e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,12 @@ jobs: matrix: ruby_version: - "3.2" + - "4.0" include: - ruby_version: '3.2' puppet_gem_version: '~> 8.0' + - ruby_version: '4.0' + puppet_gem_version: '~> 9.0' runs_on: - "ubuntu-latest" - "windows-latest" @@ -40,9 +43,12 @@ jobs: matrix: ruby_version: - "3.2" + - "4.0" include: - ruby_version: '3.2' puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8' + - ruby_version: '4.0' + puppet_gem_version: '~> 9.0' runs_on: - "ubuntu-latest" - "windows-latest" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 304e9722..63aee7f1 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,9 +12,12 @@ jobs: matrix: ruby_version: - "3.2" + - "4.0" include: - ruby_version: '3.2' puppet_gem_version: '~> 8.0' + - ruby_version: '4.0' + puppet_gem_version: '~> 9.0' runs_on: - "ubuntu-latest" - "windows-latest" @@ -32,9 +35,12 @@ jobs: matrix: ruby_version: - "3.2" + - "4.0" include: - ruby_version: '3.2' puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8' + - ruby_version: '4.0' + puppet_gem_version: '~> 9.0' runs_on: - "ubuntu-latest" - "windows-latest" diff --git a/Gemfile b/Gemfile index 00823ad9..c202b28e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,17 @@ # frozen_string_literal: true -source ENV['GEM_SOURCE'] || "https://rubygems.org" +# For puppetcore, set GEM_SOURCE_PUPPETCORE = 'https://rubygems-puppetcore.puppet.com' +gemsource_default = ENV['GEM_SOURCE'] || "https://rubygems.org" +gemsource_puppetcore = if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + 'https://rubygems-puppetcore.puppet.com' + else + ENV['GEM_SOURCE_PUPPETCORE'] || gemsource_default + end +source gemsource_default gemspec -def location_for(place_or_version, fake_version = nil) +def location_for(place_or_version, fake_version = nil, opts = {}) git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} file_url_regex = %r{\Afile:\/\/(?.*)} @@ -13,12 +20,12 @@ def location_for(place_or_version, fake_version = nil) elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] else - [place_or_version, { require: false }] + [place_or_version, { require: false }.merge(opts)] end end group :development do - gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION']) + gem 'puppet', *location_for(ENV.fetch('PUPPET_GEM_VERSION', nil), nil, { source: gemsource_puppetcore }) gem 'json_spec', '~> 1.1', '>= 1.1.5' @@ -48,6 +55,8 @@ group :development do end group :acceptance do + # Source bolt from puppetcore too, since it's a transitive puppet_litmus dependency. + gem 'bolt', *location_for(ENV.fetch('BOLT_GEM_VERSION', nil), nil, { source: gemsource_puppetcore }) gem 'puppet_litmus' gem 'net-ssh' end