Skip to content

Commit 440d030

Browse files
authored
Merge pull request #93 from puppetlabs/PA-7366
(PA-7366) Use puppetcore for testing
2 parents 975edaa + f14ce32 commit 440d030

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
@@ -53,18 +53,21 @@ 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']
59-
6056
gems = {}
57+
puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil)
58+
facter_version = ENV.fetch('FACTER_GEM_VERSION', nil)
59+
hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil)
6160

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

67-
gems['facter'] = location_for(facter_version) if facter_version
6871
gems['hiera'] = location_for(hiera_version) if hiera_version
6972

7073
gems.each do |gem_name, gem_params|

0 commit comments

Comments
 (0)