Skip to content

Commit 824fc57

Browse files
committed
Use puppetcore for testing
Updated gemfile for puppetcore changes
1 parent ac456c7 commit 824fc57

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.github/workflows/static_code_analysis.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ on:
1111
jobs:
1212
static_code_analysis:
1313
uses: "puppetlabs/phoenix-github-actions/.github/workflows/static_code_analysis.yaml@main"
14+
secrets: inherit

.github/workflows/unit_tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
Nightly:
1313
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
14+
secrets: inherit
1415

1516
Released:
1617
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main"
18+
secrets: inherit

Gemfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,22 @@ group :system_tests do
5353
gem "voxpupuli-acceptance", require: false
5454
end
5555

56-
puppet_version = ENV['PUPPET_GEM_VERSION']
57-
facter_version = ENV['FACTER_GEM_VERSION']
58-
hiera_version = ENV['HIERA_GEM_VERSION']
56+
puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil)
57+
facter_version = ENV.fetch('FACTER_GEM_VERSION', nil)
58+
hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil)
5959

6060
gems = {}
6161

62-
gems['puppet'] = location_for(puppet_version)
63-
64-
# If facter or hiera versions have been specified via the environment
65-
# variables
62+
# If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet
63+
# Otherwise, do as before and use location_for to fetch gems from the default source
64+
if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
65+
gems['puppet'] = ['~> 8.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }]
66+
gems['facter'] = ['~> 4.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }]
67+
else
68+
gems['puppet'] = location_for(puppet_version)
69+
gems['facter'] = location_for(facter_version) if facter_version
70+
end
6671

67-
gems['facter'] = location_for(facter_version) if facter_version
6872
gems['hiera'] = location_for(hiera_version) if hiera_version
6973

7074
gems.each do |gem_name, gem_params|

0 commit comments

Comments
 (0)