Skip to content

Commit 33f0404

Browse files
(PA-7366) Use puppetcore for testing
1 parent 915e5b0 commit 33f0404

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
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 & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,21 @@ group :system_tests do
4646
gem "voxpupuli-acceptance", require: false
4747
end
4848

49-
puppet_version = ENV['PUPPET_GEM_VERSION']
50-
facter_version = ENV['FACTER_GEM_VERSION']
51-
hiera_version = ENV['HIERA_GEM_VERSION']
52-
5349
gems = {}
50+
puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil)
51+
facter_version = ENV.fetch('FACTER_GEM_VERSION', nil)
52+
hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil)
5453

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

60-
gems['facter'] = location_for(facter_version) if facter_version
6164
gems['hiera'] = location_for(hiera_version) if hiera_version
6265

6366
gems.each do |gem_name, gem_params|

0 commit comments

Comments
 (0)