Skip to content

Commit d3447d7

Browse files
authored
Merge pull request #2541 from mhashizume/maint/main/checkout_action
(maint) GitHub Actions maintenance
2 parents 114d3ef + 0532109 commit d3447d7

File tree

7 files changed

+32
-18
lines changed

7 files changed

+32
-18
lines changed

.github/actions/presuite.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def initialize_beaker
3232
def beaker_platform
3333
{
3434
'ubuntu-20.04' => 'ubuntu2004-64a',
35-
'macos-latest' => 'osx11-64a',
35+
'macos-11' => 'osx11-64a',
3636
'windows-2016' => 'windows2016-64a',
3737
'windows-2019' => 'windows2019-64a'
3838
}[HOST_PLATFORM]
@@ -48,9 +48,19 @@ def install_puppet_agent
4848
message('INSTALL PUPPET AGENT')
4949

5050
beaker_puppet_root = run('bundle info beaker-puppet --path')
51-
presuite_file_path = File.join(beaker_puppet_root.chomp, 'setup', 'aio', '010_Install_Puppet_Agent.rb')
5251

53-
run("beaker exec pre-suite --pre-suite #{presuite_file_path} --preserve-state", './', env_path_var)
52+
# Bundler/Rubygems can sometimes give output other than the filepath (deprecation warnings, etc.)
53+
begin
54+
if File.exist?(beaker_puppet_root.chomp)
55+
presuite_file_path = File.join(beaker_puppet_root.chomp, 'setup', 'aio', '010_Install_Puppet_Agent.rb')
56+
57+
run("beaker exec pre-suite --pre-suite #{presuite_file_path} --preserve-state", './', env_path_var)
58+
else
59+
exit
60+
end
61+
rescue SystemExit
62+
puts "`bundle info beaker-puppet --path` produced unexpected output, please address this."
63+
end
5464
end
5565

5666
def puppet_puppet_bin_dir

.github/workflows/acceptance_tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: Platform
1515
strategy:
1616
matrix:
17-
os: [ windows-2019, ubuntu-20.04, macos-latest ]
17+
os: [ windows-2019, ubuntu-20.04, macos-11 ]
1818
runs-on: ${{ matrix.os }}
1919
env:
2020
BEAKER_debug: true
@@ -24,14 +24,15 @@ jobs:
2424

2525
steps:
2626
- name: Checkout current PR
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
2828
with:
2929
path: facter
3030

31-
- name: Install Ruby 2.6
31+
- name: Install Ruby 2.7
3232
uses: ruby/setup-ruby@v1
3333
with:
34-
ruby-version: '2.6'
34+
ruby-version: '2.7'
35+
rubygems: '3.3.26'
3536

3637
- name: Fix common Linux and macOS permissions
3738
if: runner.os != 'Windows'

.github/workflows/checks.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ jobs:
1515
name: RuboCop
1616
steps:
1717
- name: Checkout current PR
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919

2020
- name: Rubocop checks
2121
uses: ruby/setup-ruby@v1
2222
with:
23-
ruby-version: 2.6
23+
ruby-version: '2.7'
2424
- run: bundle install --jobs 3 --retry 3
2525
- run: bundle exec rubocop --parallel
2626

2727
rtc:
2828
runs-on: ubuntu-20.04
2929
name: RuboCop TODO
3030
steps:
31-
- uses: actions/checkout@v1
31+
- uses: actions/checkout@v3
3232
- uses: gimmyxd/[email protected]
3333
env:
3434
RTC_TOKEN: ${{ secrets.RTC_TOKEN }}
@@ -42,13 +42,13 @@ jobs:
4242
name: commit message
4343
steps:
4444
- name: Checkout current PR
45-
uses: actions/checkout@v2
45+
uses: actions/checkout@v3
4646
with:
4747
fetch-depth: 2
4848

4949
- name: Commit message checks
5050
uses: ruby/setup-ruby@v1
5151
with:
52-
ruby-version: 2.6
52+
ruby-version: '2.7'
5353
- run: bundle install --jobs 3 --retry 3
5454
- run: bundle exec rake commits

.github/workflows/coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: coverage
1313
steps:
1414
- name: Checkout current PR
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616

1717
- name: Setup Code Climate test-reporter
1818
run: |
@@ -23,7 +23,7 @@ jobs:
2323
- name: Generate coverage
2424
uses: ruby/setup-ruby@v1
2525
with:
26-
ruby-version: 2.6
26+
ruby-version: '2.7'
2727
- run: bundle install --jobs 3 --retry 3
2828
- run: bundle exec rake spec
2929

.github/workflows/snyk_monitor.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
name: Snyk Monitor
1212
steps:
1313
- name: Checkout current PR
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515
- name: Setup Ruby
1616
uses: ruby/setup-ruby@v1
1717
with:
18-
ruby-version: 2.7
18+
ruby-version: '2.7'
1919
- name: Install dependencies
2020
run: bundle install --jobs 3 --retry 3
2121
- name: Run Snyk to check for vulnerabilities

.github/workflows/unit_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-20.04
2727
steps:
2828
- name: Checkout current PR
29-
uses: actions/checkout@v2
29+
uses: actions/checkout@v3
3030

3131
- name: Rspec checks
3232
uses: ruby/setup-ruby@v1
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: windows-2019
4848
steps:
4949
- name: Checkout current PR
50-
uses: actions/checkout@v2
50+
uses: actions/checkout@v3
5151

5252
- name: Rspec checks
5353
uses: ruby/setup-ruby@v1

spec/mocks/win32.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ def keys; end
66

77
def close; end
88

9+
module API
10+
end
11+
912
class HKEY_LOCAL_MACHINE
1013
def self.open(*); end
1114

0 commit comments

Comments
 (0)