Skip to content

Commit 1e8932d

Browse files
committed
(MODULES-8748) Use latest PowerShell Core versions in CI
Previously the default installed versions of PowerShell Core were used in Travis CI and Appveyor. This commit updates the CI configuration files to use the latest stable release of PowerShell Core, using the same bootstrapping files the PowerShell team uses [1]. [1] https://github.com/PowerShell/PowerShell/tree/master/tools
1 parent 881331b commit 1e8932d

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

.sync.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ spec/default_facts.yml:
2727
.travis.yml:
2828
unmanaged: true
2929

30+
# Due to https://github.com/puppetlabs/pdk-templates/issues/229 we can't manage Appveyor yet.
3031
appveyor.yml:
31-
test_script:
32-
- pwsh -NoProfile -NoLogo -NonInteractive -Command $PSVersionTable
33-
- powershell -NoProfile -NoLogo -NonInteractive -Command $PSVersionTable
32+
unmanaged: true
3433

3534
.gitlab-ci.yml:
3635
delete: true

.travis.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,7 @@ language: ruby
1111
cache: bundler
1212
before_install:
1313
# Additional instructions
14-
# Install PowerShell Core for Ubuntu 14.04
15-
# There's an intermittent minor issue with the public key so just reset it with apt-key ... - https://github.com/git-lfs/git-lfs/issues/3474
16-
- if [ $TRAVIS_OS_NAME == "linux" ]; then
17-
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -;
18-
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list;
19-
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157;
20-
sudo apt-get update;
21-
sudo apt-get install -y powershell;
22-
fi
23-
# Install PowerShell Core for Mac
24-
- if [ $TRAVIS_OS_NAME == "osx" ]; then
25-
brew cask install powershell;
26-
fi
14+
- bash <(curl -s https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -skip-sudo-check
2715
# Output the PowerShell Core version information
2816
- pwsh -NoProfile -NoLogo -NonInteractive -Command \$PSVersionTable
2917
- if [ $BUNDLER_VERSION ]; then

appveyor.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ install:
3939
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
4040
- bundle install --jobs 4 --retry 2 --without system_tests
4141
- type Gemfile.lock
42+
- ps: "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/raw/master/tools/install-powershell.ps1 -UseBasicParsing -OutFile install-pwsh.ps1"
43+
- ps: "& ./install-pwsh.ps1"
44+
- set PATH=%LOCALAPPDATA%\Microsoft\powershell;%PATH%
45+
- pwsh -NoProfile -NoLogo -NonInteractive -Command $PSVersionTable
46+
- powershell -NoProfile -NoLogo -NonInteractive -Command $PSVersionTable
4247
build: off
4348
test_script:
4449
- bundle exec puppet -V
4550
- ruby -v
4651
- gem -v
4752
- bundle -v
4853
- bundle exec rake %CHECK%
49-
- pwsh -NoProfile -NoLogo -NonInteractive -Command $PSVersionTable
50-
- powershell -NoProfile -NoLogo -NonInteractive -Command $PSVersionTable
5154
notifications:
5255
- provider: Email
5356
to:

0 commit comments

Comments
 (0)