├── .github-actions ├── .gitattributes ├── .github │ ├── CODEOWNERS │ ├── ISSUE_TEMPLATE │ │ ├── announcement.yml │ │ ├── bug-report.yml │ │ ├── config.yml │ │ └── tool-request.yml │ ├── pull_request_template.md │ └── workflows │ │ ├── codeql-analysis.yml │ │ ├── create_github_release.yml │ │ ├── create_pull_request.yml │ │ ├── linter.yml │ │ ├── merge_pull_request.yml │ │ └── update_github_release.yml ├── .gitignore ├── .vscode │ ├── settings.json │ └── tasks.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── docs │ ├── create-image-and-azure-resources.md │ ├── debugging-failed-builds.md │ └── resources │ │ ├── askOnError.png │ │ ├── packerResourceGroup.png │ │ ├── resourceGroupName.png │ │ └── vmCredentials.png ├── helpers │ ├── CreateAzureVMFromPackerTemplate.ps1 │ └── GenerateResourcesAndImage.ps1 ├── images.CI │ ├── credscan-exclusions.json │ ├── download-repo.ps1 │ ├── linux-and-win │ │ ├── azure-pipelines │ │ │ ├── image-generation.yml │ │ │ ├── ubuntu1804.yml │ │ │ ├── ubuntu2004.yml │ │ │ ├── ubuntu2204.yml │ │ │ ├── windows2019.yml │ │ │ └── windows2022.yml │ │ ├── build-image.ps1 │ │ ├── cleanup.ps1 │ │ └── create-release.ps1 │ ├── macos │ │ ├── anka │ │ │ ├── Anka.Helpers.psm1 │ │ │ ├── CreateCleanAnkaTemplate.ps1 │ │ │ └── Service.Helpers.psm1 │ │ ├── azure-pipelines │ │ │ ├── image-generation.yml │ │ │ ├── macos1015.yml │ │ │ ├── macos11.yml │ │ │ └── macos12.yml │ │ ├── destroy-vm.ps1 │ │ ├── helpers.psm1 │ │ ├── move-vm.ps1 │ │ ├── select-datastore.ps1 │ │ └── validate-contributor.ps1 │ ├── measure-provisioners-duration.ps1 │ └── shebang-linter.ps1 └── images │ ├── linux │ ├── Ubuntu1804-Readme.md │ ├── Ubuntu2004-Readme.md │ ├── Ubuntu2204-Readme.md │ ├── config │ │ ├── ubuntu1804.conf │ │ ├── ubuntu2004.conf │ │ └── ubuntu2204.conf │ ├── post-generation │ │ ├── cleanup-logs.sh │ │ ├── environment-variables.sh │ │ └── systemd-linger.sh │ ├── scripts │ │ ├── SoftwareReport │ │ │ ├── SoftwareReport.Android.psm1 │ │ │ ├── SoftwareReport.Browsers.psm1 │ │ │ ├── SoftwareReport.CachedTools.psm1 │ │ │ ├── SoftwareReport.Common.psm1 │ │ │ ├── SoftwareReport.Databases.psm1 │ │ │ ├── SoftwareReport.Generator.ps1 │ │ │ ├── SoftwareReport.Java.psm1 │ │ │ ├── SoftwareReport.Rust.psm1 │ │ │ ├── SoftwareReport.Tools.psm1 │ │ │ └── SoftwareReport.WebServers.psm1 │ │ ├── base │ │ │ ├── apt-mock-remove.sh │ │ │ ├── apt-mock.sh │ │ │ ├── apt.sh │ │ │ ├── limits.sh │ │ │ ├── reboot.sh │ │ │ ├── repos.sh │ │ │ └── snap.sh │ │ ├── helpers │ │ │ ├── Common.Helpers.psm1 │ │ │ ├── SoftwareReport.Helpers.psm1 │ │ │ ├── Tests.Helpers.psm1 │ │ │ ├── etc-environment.sh │ │ │ ├── install.sh │ │ │ ├── invoke-tests.sh │ │ │ └── os.sh │ │ ├── installers │ │ │ ├── Configure-Toolset.ps1 │ │ │ ├── Install-AzureModules.ps1 │ │ │ ├── Install-PowerShellModules.ps1 │ │ │ ├── Install-Toolset.ps1 │ │ │ ├── aliyun-cli.sh │ │ │ ├── android.sh │ │ │ ├── apache.sh │ │ │ ├── aws.sh │ │ │ ├── azcopy.sh │ │ │ ├── azure-cli.sh │ │ │ ├── azure-devops-cli.sh │ │ │ ├── basic.sh │ │ │ ├── bazel.sh │ │ │ ├── bicep.sh │ │ │ ├── clang.sh │ │ │ ├── cleanup.sh │ │ │ ├── cmake.sh │ │ │ ├── codeql-bundle.sh │ │ │ ├── complete-snap-setup.sh │ │ │ ├── configure-environment.sh │ │ │ ├── containers.sh │ │ │ ├── docker-compose.sh │ │ │ ├── docker-moby.sh │ │ │ ├── dotnetcore-sdk.sh │ │ │ ├── dpkg-config.sh │ │ │ ├── erlang.sh │ │ │ ├── example.sh │ │ │ ├── firefox.sh │ │ │ ├── gcc.sh │ │ │ ├── gfortran.sh │ │ │ ├── git.sh │ │ │ ├── github-cli.sh │ │ │ ├── google-chrome.sh │ │ │ ├── google-cloud-sdk.sh │ │ │ ├── graalvm.sh │ │ │ ├── haskell.sh │ │ │ ├── heroku.sh │ │ │ ├── hhvm.sh │ │ │ ├── homebrew.sh │ │ │ ├── java-tools.sh │ │ │ ├── julia.sh │ │ │ ├── kotlin.sh │ │ │ ├── kubernetes-tools.sh │ │ │ ├── leiningen.sh │ │ │ ├── microsoft-edge.sh │ │ │ ├── miniconda.sh │ │ │ ├── mongodb.sh │ │ │ ├── mono.sh │ │ │ ├── mssql-cmd-tools.sh │ │ │ ├── mysql.sh │ │ │ ├── nginx.sh │ │ │ ├── nodejs.sh │ │ │ ├── nvm.sh │ │ │ ├── oc.sh │ │ │ ├── oras-cli.sh │ │ │ ├── packer.sh │ │ │ ├── phantomjs.sh │ │ │ ├── php.sh │ │ │ ├── pipx-packages.sh │ │ │ ├── post-deployment.sh │ │ │ ├── postgresql.sh │ │ │ ├── powershellcore.sh │ │ │ ├── preimagedata.sh │ │ │ ├── pulumi.sh │ │ │ ├── pypy.sh │ │ │ ├── python.sh │ │ │ ├── r.sh │ │ │ ├── ruby.sh │ │ │ ├── rust.sh │ │ │ ├── sbt.sh │ │ │ ├── selenium.sh │ │ │ ├── sphinx.sh │ │ │ ├── sqlpackage.sh │ │ │ ├── swift.sh │ │ │ ├── terraform.sh │ │ │ ├── validate-disk-space.sh │ │ │ ├── vcpkg.sh │ │ │ └── yq.sh │ │ └── tests │ │ │ ├── Android.Tests.ps1 │ │ │ ├── Apt.Tests.ps1 │ │ │ ├── Browsers.Tests.ps1 │ │ │ ├── CLI.Tools.Tests.ps1 │ │ │ ├── Common.Tests.ps1 │ │ │ ├── Databases.Tests.ps1 │ │ │ ├── DotnetSDK.Tests.ps1 │ │ │ ├── Haskell.Tests.ps1 │ │ │ ├── Java.Tests.ps1 │ │ │ ├── Node.Tests.ps1 │ │ │ ├── PowerShellModules.Tests.ps1 │ │ │ ├── RunAll-Tests.ps1 │ │ │ ├── Tools.Tests.ps1 │ │ │ ├── Toolset.Tests.ps1 │ │ │ └── WebServers.Tests.ps1 │ ├── toolsets │ │ ├── toolset-1804.json │ │ ├── toolset-2004.json │ │ └── toolset-2204.json │ ├── ubuntu1804.json │ ├── ubuntu2004.json │ └── ubuntu2204.pkr.hcl │ ├── macos │ ├── helpers │ │ ├── Common.Helpers.psm1 │ │ ├── SoftwareReport.Helpers.psm1 │ │ ├── Tests.Helpers.psm1 │ │ ├── Xcode.Helpers.psm1 │ │ └── Xcode.Installer.psm1 │ ├── macos-10.15-Readme.md │ ├── macos-11-Readme.md │ ├── macos-12-Readme.md │ ├── provision │ │ ├── assets │ │ │ ├── select-xamarin-sdk-v2.sh │ │ │ └── select-xamarin-sdk.sh │ │ ├── bootstrap-provisioner │ │ │ ├── change_password │ │ │ ├── installNewProvisioner.sh │ │ │ ├── kcpassword.py │ │ │ └── setAutoLogin.sh │ │ ├── configuration │ │ │ ├── add-certificate.swift │ │ │ ├── add-network-interface-detection.sh │ │ │ ├── autologin.sh │ │ │ ├── configure-hostname.sh │ │ │ ├── configure-machine.sh │ │ │ ├── configure-ssh.sh │ │ │ ├── configure-tccdb-macos.sh │ │ │ ├── disable-auto-updates.sh │ │ │ ├── environment │ │ │ │ ├── bashprofile │ │ │ │ └── bashrc │ │ │ ├── finalize-vm.sh │ │ │ ├── max-files.sh │ │ │ ├── ntpconf.sh │ │ │ ├── preimagedata.sh │ │ │ ├── screensaver-off.sh │ │ │ └── shell-change.sh │ │ ├── core │ │ │ ├── android-toolsets.sh │ │ │ ├── apache.sh │ │ │ ├── audiodevice.sh │ │ │ ├── aws.sh │ │ │ ├── azcopy.sh │ │ │ ├── bicep.sh │ │ │ ├── build-xcode-symlinks.sh │ │ │ ├── chrome.sh │ │ │ ├── cocoapods.sh │ │ │ ├── commonutils.sh │ │ │ ├── configure-toolset.ps1 │ │ │ ├── delete-duplicate-sims.rb │ │ │ ├── dotnet.sh │ │ │ ├── edge.sh │ │ │ ├── firefox.sh │ │ │ ├── gcc.sh │ │ │ ├── git.sh │ │ │ ├── golang.sh │ │ │ ├── graalvm.sh │ │ │ ├── haskell.sh │ │ │ ├── homebrew.sh │ │ │ ├── llvm.sh │ │ │ ├── miniconda.sh │ │ │ ├── mongodb.sh │ │ │ ├── nginx.sh │ │ │ ├── node.sh │ │ │ ├── nvm.sh │ │ │ ├── open_windows_check.sh │ │ │ ├── openjdk.sh │ │ │ ├── openssl.sh │ │ │ ├── php.sh │ │ │ ├── pipx-packages.sh │ │ │ ├── postgresql.sh │ │ │ ├── powershell.sh │ │ │ ├── pypy.sh │ │ │ ├── python.sh │ │ │ ├── reboot.sh │ │ │ ├── ruby.sh │ │ │ ├── rubygem.sh │ │ │ ├── rust.sh │ │ │ ├── safari.sh │ │ │ ├── stack.sh │ │ │ ├── swiftlint.sh │ │ │ ├── toolset.ps1 │ │ │ ├── vcpkg.sh │ │ │ ├── vsmac.sh │ │ │ ├── xamarin.sh │ │ │ ├── xcode-clt.sh │ │ │ ├── xcode-postbuild.sh │ │ │ ├── xcode-sims.sh │ │ │ └── xcode.ps1 │ │ └── utils │ │ │ ├── confirm-identified-developers.scpt │ │ │ ├── invoke-tests.sh │ │ │ ├── utils.sh │ │ │ └── xamarin-utils.sh │ ├── software-report │ │ ├── SoftwareReport.Android.psm1 │ │ ├── SoftwareReport.Browsers.psm1 │ │ ├── SoftwareReport.Common.psm1 │ │ ├── SoftwareReport.Generator.ps1 │ │ ├── SoftwareReport.Java.psm1 │ │ ├── SoftwareReport.Toolcache.psm1 │ │ ├── SoftwareReport.WebServers.psm1 │ │ ├── SoftwareReport.Xamarin.psm1 │ │ └── SoftwareReport.Xcode.psm1 │ ├── templates │ │ ├── macOS-10.15.json │ │ ├── macOS-11.anka.pkr.hcl │ │ ├── macOS-11.json │ │ ├── macOS-12.anka.pkr.hcl │ │ └── macOS-12.json │ ├── tests │ │ ├── Android.Tests.ps1 │ │ ├── BasicTools.Tests.ps1 │ │ ├── Browsers.Tests.ps1 │ │ ├── Common.Tests.ps1 │ │ ├── Databases.Tests.ps1 │ │ ├── Git.Tests.ps1 │ │ ├── Haskell.Tests.ps1 │ │ ├── Java.Tests.ps1 │ │ ├── LLVM.Tests.ps1 │ │ ├── Linters.Tests.ps1 │ │ ├── Node.Tests.ps1 │ │ ├── OpenSSL.Tests.ps1 │ │ ├── PHP.Tests.ps1 │ │ ├── PipxPackages.Tests.ps1 │ │ ├── Powershell.Tests.ps1 │ │ ├── Python.Tests.ps1 │ │ ├── Ruby.Tests.ps1 │ │ ├── RubyGem.Tests.ps1 │ │ ├── RunAll-Tests.ps1 │ │ ├── Rust.Tests.ps1 │ │ ├── System.Tests.ps1 │ │ ├── Toolcache.Tests.ps1 │ │ ├── WebServers.Tests.ps1 │ │ ├── Xamarin.Tests.ps1 │ │ └── Xcode.Tests.ps1 │ └── toolsets │ │ ├── Readme.md │ │ ├── Toolset.Tests.ps1 │ │ ├── toolset-10.15.json │ │ ├── toolset-11.json │ │ └── toolset-12.json │ └── win │ ├── Windows2019-Readme.md │ ├── Windows2022-Readme.md │ ├── post-generation │ ├── GenerateIISExpressCertificate.ps1 │ ├── InternetExplorerConfiguration.ps1 │ ├── Msys2FirstLaunch.ps1 │ └── VSConfiguration.ps1 │ ├── scripts │ ├── ImageHelpers │ │ ├── ChocoHelpers.ps1 │ │ ├── ImageHelpers.psd1 │ │ ├── ImageHelpers.psm1 │ │ ├── InstallHelpers.ps1 │ │ ├── PathHelpers.ps1 │ │ ├── TestsHelpers.ps1 │ │ ├── VisualStudioHelpers.ps1 │ │ └── test │ │ │ ├── ImageHelpers.Tests.ps1 │ │ │ └── PathHelpers.Tests.ps1 │ ├── Installers │ │ ├── Configure-Antivirus.ps1 │ │ ├── Configure-DynamicPort.ps1 │ │ ├── Configure-GDIProcessHandleQuota.ps1 │ │ ├── Configure-Shell.ps1 │ │ ├── Configure-Toolset.ps1 │ │ ├── Disable-JITDebugger.ps1 │ │ ├── Enable-DeveloperMode.ps1 │ │ ├── Finalize-VM.ps1 │ │ ├── Initialize-VM.ps1 │ │ ├── Install-AWS.ps1 │ │ ├── Install-AliyunCli.ps1 │ │ ├── Install-AndroidSDK.ps1 │ │ ├── Install-Apache.ps1 │ │ ├── Install-AzureCli.ps1 │ │ ├── Install-AzureCosmosDbEmulator.ps1 │ │ ├── Install-AzureDevOpsCli.ps1 │ │ ├── Install-AzureModules.ps1 │ │ ├── Install-Bazel.ps1 │ │ ├── Install-BizTalkBuildComponent.ps1 │ │ ├── Install-Choco.ps1 │ │ ├── Install-Chrome.ps1 │ │ ├── Install-CloudFoundryCli.ps1 │ │ ├── Install-CodeQLBundle.ps1 │ │ ├── Install-CommonUtils.ps1 │ │ ├── Install-DACFx.ps1 │ │ ├── Install-Docker.ps1 │ │ ├── Install-DotnetSDK.ps1 │ │ ├── Install-Edge.ps1 │ │ ├── Install-Firefox.ps1 │ │ ├── Install-Git.ps1 │ │ ├── Install-GitHub-CLI.ps1 │ │ ├── Install-GoogleCloudSDK.ps1 │ │ ├── Install-Haskell.ps1 │ │ ├── Install-IEWebDriver.ps1 │ │ ├── Install-JavaTools.ps1 │ │ ├── Install-Kotlin.ps1 │ │ ├── Install-KubernetesTools.ps1 │ │ ├── Install-LLVM.ps1 │ │ ├── Install-Mercurial.ps1 │ │ ├── Install-Mingw64.ps1 │ │ ├── Install-Miniconda.ps1 │ │ ├── Install-MongoDB.ps1 │ │ ├── Install-Msys2.ps1 │ │ ├── Install-MysqlCli.ps1 │ │ ├── Install-NET48.ps1 │ │ ├── Install-NSIS.ps1 │ │ ├── Install-Nginx.ps1 │ │ ├── Install-NodeLts.ps1 │ │ ├── Install-PHP.ps1 │ │ ├── Install-Pipx.ps1 │ │ ├── Install-PipxPackages.ps1 │ │ ├── Install-PostgreSQL.ps1 │ │ ├── Install-PowerShellModules.ps1 │ │ ├── Install-PowershellCore.ps1 │ │ ├── Install-PyPy.ps1 │ │ ├── Install-R.ps1 │ │ ├── Install-RootCA.ps1 │ │ ├── Install-Ruby.ps1 │ │ ├── Install-Rust.ps1 │ │ ├── Install-SQLOLEDBDriver.ps1 │ │ ├── Install-SQLPowerShellTools.ps1 │ │ ├── Install-Sbt.ps1 │ │ ├── Install-Selenium.ps1 │ │ ├── Install-ServiceFabricSDK.ps1 │ │ ├── Install-Stack.ps1 │ │ ├── Install-Toolset.ps1 │ │ ├── Install-VCRedist.ps1 │ │ ├── Install-VS.ps1 │ │ ├── Install-Vcpkg.ps1 │ │ ├── Install-Vsix.ps1 │ │ ├── Install-WDK.ps1 │ │ ├── Install-WebPlatformInstaller.ps1 │ │ ├── Install-WinAppDriver.ps1 │ │ ├── Install-WindowsFeatures.ps1 │ │ ├── Install-WindowsUpdates.ps1 │ │ ├── Install-Wix.ps1 │ │ ├── Install-Zstd.ps1 │ │ ├── Run-NGen.ps1 │ │ ├── Update-DotnetTLS.ps1 │ │ ├── Update-ImageData.ps1 │ │ └── Wait-WindowsUpdatesForInstall.ps1 │ ├── README.md │ ├── SoftwareReport │ │ ├── SoftwareReport.Android.psm1 │ │ ├── SoftwareReport.Browsers.psm1 │ │ ├── SoftwareReport.CachedTools.psm1 │ │ ├── SoftwareReport.Common.psm1 │ │ ├── SoftwareReport.Databases.psm1 │ │ ├── SoftwareReport.Generator.ps1 │ │ ├── SoftwareReport.Helpers.psm1 │ │ ├── SoftwareReport.Java.psm1 │ │ ├── SoftwareReport.Tools.psm1 │ │ ├── SoftwareReport.VisualStudio.psm1 │ │ └── SoftwareReport.WebServers.psm1 │ └── Tests │ │ ├── Android.Tests.ps1 │ │ ├── Apache.Tests.ps1 │ │ ├── BizTalk.Tests.ps1 │ │ ├── Browsers.Tests.ps1 │ │ ├── CLI.Tools.Tests.ps1 │ │ ├── ChocoPackages.Tests.ps1 │ │ ├── Databases.Tests.ps1 │ │ ├── Docker.Tests.ps1 │ │ ├── DotnetSDK.Tests.ps1 │ │ ├── Git.Tests.ps1 │ │ ├── Haskell.Tests.ps1 │ │ ├── Java.Tests.ps1 │ │ ├── LLVM.Tests.ps1 │ │ ├── MSYS2.Tests.ps1 │ │ ├── Miniconda.Tests.ps1 │ │ ├── Nginx.Tests.ps1 │ │ ├── Node.Tests.ps1 │ │ ├── PHP.Tests.ps1 │ │ ├── PipxPackages.Tests.ps1 │ │ ├── PowerShellModules.Tests.ps1 │ │ ├── RunAll-Tests.ps1 │ │ ├── Rust.Tests.ps1 │ │ ├── SSDTExtensions.Tests.ps1 │ │ ├── Shell.Tests.ps1 │ │ ├── Tools.Tests.ps1 │ │ ├── Toolset.Tests.ps1 │ │ ├── VisualStudio.Tests.ps1 │ │ ├── Vsix.Tests.ps1 │ │ ├── WDK.Tests.ps1 │ │ ├── WinAppDriver.Tests.ps1 │ │ ├── WindowsFeatures.Tests.ps1 │ │ └── Wix.Tests.ps1 │ ├── toolsets │ ├── toolset-2019.json │ └── toolset-2022.json │ ├── windows2019.json │ └── windows2022.json ├── .gitignore ├── Configure-IIS.ps1 ├── Disable-RealTimeMonitoring.ps1 ├── Docker ├── Install-DockerDesktop.ps1 └── Install-DockerTools.ps1 ├── Enable-PSRemoting.ps1 ├── Install-AzureTools.ps1 ├── Install-Boxstarter.ps1 ├── Install-CollaborationTools.ps1 ├── Install-Common.ps1 ├── Install-CosmosDb.ps1 ├── Install-DevTools.ps1 ├── Install-Dotfiles.ps1 ├── Install-DotnetCore.ps1 ├── Install-GitTools.ps1 ├── Install-GoTools.ps1 ├── Install-Java.ps1 ├── Install-MongoTools.ps1 ├── Install-MySql.ps1 ├── Install-NodeTools.ps1 ├── Install-OneDrive.ps1 ├── Install-OpenSsh.ps1 ├── Install-PgpTools.ps1 ├── Install-PostgreSql.ps1 ├── Install-PythonTools.ps1 ├── Install-ReactNative.ps1 ├── Install-VisualStudio2022.ps1 ├── Install-VsCode.ps1 ├── LICENSE ├── MacOS ├── .zshrc ├── Install-DevTools.sh ├── Install-Docker.sh ├── README.md ├── Setup.sh └── bash_profile ├── README.md ├── Run-ManualBasicInstall.ps1 ├── SQL-Server ├── Add-SqlServerAlias.ps1 ├── Install-SqlPowerShellModule.ps1 └── Install-SqlServer.ps1 ├── Sysprep.bat ├── Ubuntu └── README.md ├── Update-GitSubtree.ps1 ├── Use-Vagrant.ps1 ├── Vagrantfile.multi ├── Vagrantfile.template ├── Windows-10-Enterprise ├── Build.ps1 ├── autounattend.xml └── windows-10-enterprise.json ├── Windows-10-Pro ├── Build.ps1 ├── autounattend.xml └── windows-10-pro.json ├── Windows-2019 ├── Build-Minimal.ps1 ├── Build.ps1 ├── autounattend.xml ├── windows-2019-minimal.json └── windows-2019.json └── Windows-2022 ├── Build.ps1 ├── autounattend.xml └── windows-2022.json /.github-actions/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf -------------------------------------------------------------------------------- /.github-actions/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @actions/virtual-environments-owners 2 | -------------------------------------------------------------------------------- /.github-actions/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | 3 | contact_links: 4 | - name: Get help in GitHub Discussions 5 | url: https://github.com/actions/virtual-environments/discussions 6 | about: Have a question? Feel free to ask in the virtual-environments GitHub Discussions! 7 | -------------------------------------------------------------------------------- /.github-actions/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | New tool, Bug fixing, or Improvement? 3 | Please include a summary of the change and which issue is fixed. Also include relevant motivation and context. 4 | **For new tools, please provide total size and installation time.** 5 | 6 | 7 | 8 | #### Related issue: 9 | 10 | ## Check list 11 | - [ ] Related issue / work item is attached 12 | - [ ] Tests are written (if applicable) 13 | - [ ] Documentation is updated (if applicable) 14 | - [ ] Changes are tested and related VM images are successfully generated 15 | -------------------------------------------------------------------------------- /.github-actions/.github/workflows/create_github_release.yml: -------------------------------------------------------------------------------- 1 | name: Create GitHub release 2 | 3 | on: 4 | repository_dispatch: 5 | types: [create-github-release] 6 | 7 | 8 | jobs: 9 | Create_GitHub_release: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - name: Create release for ${{ github.event.client_payload.ReleaseBranchName }} 16 | uses: actions/create-release@v1.1.1 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | with: 20 | tag_name: ${{ github.event.client_payload.ReleaseBranchName }} 21 | release_name: ${{ github.event.client_payload.ReleaseTitle }} 22 | body: ${{ github.event.client_payload.ReleaseBody }} 23 | prerelease: ${{ github.event.client_payload.Prerelease }} 24 | commitish: ${{ github.event.client_payload.Commitish }} -------------------------------------------------------------------------------- /.github-actions/.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | # CI Validation 2 | 3 | name: Linter 4 | 5 | on: 6 | pull_request: 7 | branches: [ main ] 8 | paths: 9 | - '**.json' 10 | - '**.md' 11 | - '**.sh' 12 | 13 | jobs: 14 | build: 15 | name: Lint JSON & MD files 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout Code 20 | uses: actions/checkout@v2 21 | with: 22 | fetch-depth: 0 23 | 24 | - name: Lint Code Base 25 | uses: github/super-linter/slim@v4 26 | env: 27 | VALIDATE_ALL_CODEBASE: false 28 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | VALIDATE_JSON: true 30 | VALIDATE_MARKDOWN: true 31 | DEFAULT_BRANCH: ${{ github.base_ref }} 32 | FILTER_REGEX_EXCLUDE: .*images/*/.*-Readme.md 33 | 34 | - name: Checking shebang lines in MacOS and Ubuntu releases. 35 | run: ./images.CI/shebang-linter.ps1 36 | shell: pwsh 37 | -------------------------------------------------------------------------------- /.github-actions/.github/workflows/update_github_release.yml: -------------------------------------------------------------------------------- 1 | name: Update release 2 | 3 | on: 4 | repository_dispatch: 5 | types: [update-github-release] 6 | 7 | 8 | jobs: 9 | Update_GitHub_release: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - name: Update release for ${{ github.event.client_payload.ReleaseBranchName }} 16 | uses: actions/github-script@v2 17 | with: 18 | github-token: ${{secrets.GITHUB_TOKEN}} 19 | script: | 20 | const response = await github.repos.getReleaseByTag({ 21 | owner: context.repo.owner, 22 | repo: context.repo.repo, 23 | tag: "${{ github.event.client_payload.ReleaseBranchName }}" 24 | }); 25 | github.repos.updateRelease({ 26 | owner: context.repo.owner, 27 | repo: context.repo.repo, 28 | release_id: response.data.id, 29 | prerelease: ${{ github.event.client_payload.Prerelease }} 30 | }); 31 | -------------------------------------------------------------------------------- /.github-actions/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.trimTrailingWhitespace": false 3 | } 4 | -------------------------------------------------------------------------------- /.github-actions/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 GitHub 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github-actions/SECURITY.md: -------------------------------------------------------------------------------- 1 | If you discover a security issue in this repo, please submit it through the [GitHub Security Bug Bounty](https://hackerone.com/github) 2 | 3 | Thanks for helping make GitHub Actions safe for everyone. 4 | -------------------------------------------------------------------------------- /.github-actions/docs/resources/askOnError.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattgwagner/New-Machine/432ebb4b2d2c8c81fba4544d13fac87e0e047e87/.github-actions/docs/resources/askOnError.png -------------------------------------------------------------------------------- /.github-actions/docs/resources/packerResourceGroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattgwagner/New-Machine/432ebb4b2d2c8c81fba4544d13fac87e0e047e87/.github-actions/docs/resources/packerResourceGroup.png -------------------------------------------------------------------------------- /.github-actions/docs/resources/resourceGroupName.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattgwagner/New-Machine/432ebb4b2d2c8c81fba4544d13fac87e0e047e87/.github-actions/docs/resources/resourceGroupName.png -------------------------------------------------------------------------------- /.github-actions/docs/resources/vmCredentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattgwagner/New-Machine/432ebb4b2d2c8c81fba4544d13fac87e0e047e87/.github-actions/docs/resources/vmCredentials.png -------------------------------------------------------------------------------- /.github-actions/images.CI/credscan-exclusions.json: -------------------------------------------------------------------------------- 1 | { 2 | "tool": "Credential Scanner", 3 | "suppressions": [ 4 | { 5 | "placeholder": "P@ssword!!", 6 | "_justification": "Password used by SQL Express. It is required to interact with database." 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /.github-actions/images.CI/download-repo.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [String] [Parameter (Mandatory=$true)] $RepoUrl, 3 | [String] [Parameter (Mandatory=$true)] $RepoBranch 4 | ) 5 | 6 | Write-Host "Clean up default repository" 7 | Remove-Item -path './*' -Recurse -Force 8 | 9 | Write-Host "Download ${RepoBranch} branch from ${RepoUrl}" 10 | $env:GIT_REDIRECT_STDERR = '2>&1' 11 | git clone $RepoUrl . -b $RepoBranch --single-branch --depth 1 12 | 13 | Write-Host "Latest commit:" 14 | git --no-pager log --pretty=format:"Date: %cd; Commit: %H - %s; Author: %an <%ae>" -1 -------------------------------------------------------------------------------- /.github-actions/images.CI/linux-and-win/azure-pipelines/ubuntu1804.yml: -------------------------------------------------------------------------------- 1 | schedules: 2 | - cron: "0 0 * * *" 3 | displayName: Daily 4 | branches: 5 | include: 6 | - main 7 | always: true 8 | 9 | trigger: none 10 | pr: 11 | autoCancel: true 12 | branches: 13 | include: 14 | - main 15 | 16 | jobs: 17 | - template: image-generation.yml 18 | parameters: 19 | image_type: ubuntu1804 20 | image_readme_name: Ubuntu1804-Readme.md -------------------------------------------------------------------------------- /.github-actions/images.CI/linux-and-win/azure-pipelines/ubuntu2004.yml: -------------------------------------------------------------------------------- 1 | schedules: 2 | - cron: "0 0 * * *" 3 | displayName: Daily 4 | branches: 5 | include: 6 | - main 7 | always: true 8 | 9 | trigger: none 10 | pr: 11 | autoCancel: true 12 | branches: 13 | include: 14 | - main 15 | 16 | jobs: 17 | - template: image-generation.yml 18 | parameters: 19 | image_type: ubuntu2004 20 | image_readme_name: Ubuntu2004-Readme.md -------------------------------------------------------------------------------- /.github-actions/images.CI/linux-and-win/azure-pipelines/ubuntu2204.yml: -------------------------------------------------------------------------------- 1 | schedules: 2 | - cron: "0 0 * * *" 3 | displayName: Daily 4 | branches: 5 | include: 6 | - main 7 | always: true 8 | 9 | trigger: none 10 | pr: 11 | autoCancel: true 12 | branches: 13 | include: 14 | - main 15 | 16 | jobs: 17 | - template: image-generation.yml 18 | parameters: 19 | image_type: ubuntu2204 20 | image_readme_name: Ubuntu2204-Readme.md -------------------------------------------------------------------------------- /.github-actions/images.CI/linux-and-win/azure-pipelines/windows2019.yml: -------------------------------------------------------------------------------- 1 | schedules: 2 | - cron: "0 0 * * *" 3 | displayName: Daily 4 | branches: 5 | include: 6 | - main 7 | always: true 8 | 9 | trigger: none 10 | pr: 11 | autoCancel: true 12 | branches: 13 | include: 14 | - main 15 | 16 | jobs: 17 | - template: image-generation.yml 18 | parameters: 19 | image_type: windows2019 20 | image_readme_name: Windows2019-Readme.md -------------------------------------------------------------------------------- /.github-actions/images.CI/linux-and-win/azure-pipelines/windows2022.yml: -------------------------------------------------------------------------------- 1 | schedules: 2 | - cron: "0 0 * * *" 3 | displayName: Daily 4 | branches: 5 | include: 6 | - main 7 | always: true 8 | 9 | trigger: none 10 | pr: 11 | autoCancel: true 12 | branches: 13 | include: 14 | - main 15 | 16 | jobs: 17 | - template: image-generation.yml 18 | parameters: 19 | image_type: windows2022 20 | image_readme_name: Windows2022-Readme.md -------------------------------------------------------------------------------- /.github-actions/images.CI/linux-and-win/create-release.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [UInt32] [Parameter (Mandatory)] $BuildId, 3 | [String] [Parameter (Mandatory)] $Organization, 4 | [String] [Parameter (Mandatory)] $Project, 5 | [String] [Parameter (Mandatory)] $ImageName, 6 | [String] [Parameter (Mandatory)] $DefinitionId, 7 | [String] [Parameter (Mandatory)] $AccessToken 8 | ) 9 | 10 | $Body = @{ 11 | definitionId = $DefinitionId 12 | variables = @{ 13 | ImageBuildId = @{ 14 | value = $BuildId 15 | } 16 | ImageName = @{ 17 | value = $ImageName 18 | } 19 | } 20 | isDraft = "false" 21 | } | ConvertTo-Json -Depth 3 22 | 23 | $URL = "https://vsrm.dev.azure.com/$Organization/$Project/_apis/release/releases?api-version=5.1" 24 | $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("'':${AccessToken}")) 25 | $headers = @{ 26 | Authorization = "Basic ${base64AuthInfo}" 27 | } 28 | 29 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls13 30 | $NewRelease = Invoke-RestMethod $URL -Body $Body -Method "POST" -Headers $headers -ContentType "application/json" 31 | 32 | Write-Host "Created release: $($NewRelease._links.web.href)" -------------------------------------------------------------------------------- /.github-actions/images.CI/macos/azure-pipelines/macos1015.yml: -------------------------------------------------------------------------------- 1 | name: macOS-10.15_$(date:yyyyMMdd)$(rev:.r)_unstable 2 | schedules: 3 | - cron: "0 0 * * *" 4 | displayName: Daily 5 | branches: 6 | include: 7 | - main 8 | always: true 9 | 10 | trigger: none 11 | pr: 12 | autoCancel: true 13 | branches: 14 | include: 15 | - main 16 | 17 | jobs: 18 | - template: image-generation.yml 19 | parameters: 20 | image_label: 'macOS Catalina' 21 | base_image_name: 'clean-macOS-10.15-380Gb-runner' 22 | template_path: 'templates/macOS-10.15.json' 23 | target_datastore: 'ds-image' 24 | -------------------------------------------------------------------------------- /.github-actions/images.CI/macos/azure-pipelines/macos11.yml: -------------------------------------------------------------------------------- 1 | name: macOS-11_$(date:yyyyMMdd)$(rev:.r)_unstable 2 | schedules: 3 | - cron: "0 0 * * *" 4 | displayName: Daily 5 | branches: 6 | include: 7 | - main 8 | always: true 9 | 10 | trigger: none 11 | pr: 12 | autoCancel: true 13 | branches: 14 | include: 15 | - main 16 | 17 | jobs: 18 | - template: image-generation.yml 19 | parameters: 20 | image_label: 'macOS Big Sur' 21 | base_image_name: 'clean-macOS-11-380Gb-runner' 22 | template_path: 'templates/macOS-11.json' 23 | target_datastore: 'ds-image' 24 | -------------------------------------------------------------------------------- /.github-actions/images.CI/macos/azure-pipelines/macos12.yml: -------------------------------------------------------------------------------- 1 | name: macOS-12_$(date:yyyyMMdd)$(rev:.r)_unstable 2 | schedules: 3 | - cron: "0 0 * * *" 4 | displayName: Daily 5 | branches: 6 | include: 7 | - main 8 | always: true 9 | 10 | trigger: none 11 | pr: 12 | autoCancel: true 13 | branches: 14 | include: 15 | - main 16 | 17 | jobs: 18 | - template: image-generation.yml 19 | parameters: 20 | image_label: 'macOS Monterey' 21 | base_image_name: 'clean-macOS-12-380Gb-runner' 22 | template_path: 'templates/macOS-12.json' 23 | target_datastore: 'ds-image' 24 | -------------------------------------------------------------------------------- /.github-actions/images.CI/macos/helpers.psm1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | 4 | Helper functions to use in images.CI scripts 5 | #> 6 | 7 | Function Connect-VCServer 8 | { 9 | [CmdletBinding()] 10 | param( 11 | [Parameter(Mandatory)] 12 | [System.String]$VIUserName, 13 | 14 | [Parameter(Mandatory)] 15 | [System.String]$VIPassword, 16 | 17 | [Parameter(Mandatory)] 18 | [System.String]$VIServer 19 | ) 20 | 21 | try 22 | { 23 | # Preference 24 | $global:ProgressPreference = 'SilentlyContinue' 25 | $global:WarningPreference = 'SilentlyContinue' 26 | # Ignore SSL 27 | $null = Set-PowerCLIConfiguration -Scope Session -InvalidCertificateAction Ignore -ParticipateInCEIP $false -Confirm:$false -WebOperationTimeoutSeconds 600 28 | $securePassword = ConvertTo-SecureString -String $VIPassword -AsPlainText -Force 29 | $cred = New-Object System.Management.Automation.PSCredential($VIUserName, $securePassword) 30 | $null = Connect-VIServer -Server $VIServer -Credential $cred -ErrorAction Stop 31 | Write-Host "Connection to the vSphere server has been established" 32 | } 33 | catch 34 | { 35 | Write-Host "##vso[task.LogIssue type=error;]Failed to connect to the vSphere server" 36 | exit 1 37 | } 38 | } -------------------------------------------------------------------------------- /.github-actions/images/linux/config/ubuntu1804.conf: -------------------------------------------------------------------------------- 1 | # Name of pool supported by this image 2 | POOL_NAME="Ubuntu 1804" 3 | -------------------------------------------------------------------------------- /.github-actions/images/linux/config/ubuntu2004.conf: -------------------------------------------------------------------------------- 1 | # Name of pool supported by this image 2 | POOL_NAME="Ubuntu 2004" 3 | -------------------------------------------------------------------------------- /.github-actions/images/linux/config/ubuntu2204.conf: -------------------------------------------------------------------------------- 1 | # Name of pool supported by this image 2 | POOL_NAME="Ubuntu 2204" 3 | -------------------------------------------------------------------------------- /.github-actions/images/linux/post-generation/cleanup-logs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # journalctl 4 | if command -v journalctl; then 5 | journalctl --rotate 6 | journalctl --vacuum-time=1s 7 | fi 8 | 9 | # delete all .gz and rotated file 10 | find /var/log -type f -regex ".*\.gz$" -delete 11 | find /var/log -type f -regex ".*\.[0-9]$" -delete 12 | 13 | # wipe log files 14 | find /var/log/ -type f -exec cp /dev/null {} \; -------------------------------------------------------------------------------- /.github-actions/images/linux/post-generation/environment-variables.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Replace $HOME with the default user's home directory for environmental variables related to the default user home directory 4 | 5 | homeDir=$(cut -d: -f6 /etc/passwd | tail -1) 6 | sed -i "s|\$HOME|$homeDir|g" /etc/environment -------------------------------------------------------------------------------- /.github-actions/images/linux/post-generation/systemd-linger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Enable user session on boot, not on login 4 | UserId=$(cut -d: -f3 /etc/passwd | tail -1) 5 | loginctl enable-linger $UserId 6 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/SoftwareReport/SoftwareReport.Java.psm1: -------------------------------------------------------------------------------- 1 | function Get-JavaVersions { 2 | $javaToolcacheVersions = Get-ChildItem $env:AGENT_TOOLSDIRECTORY/Java*/* -Directory | Sort-Object { [int]$_.Name.Split(".")[0] } 3 | 4 | $existingVersions = $javaToolcacheVersions | ForEach-Object { 5 | $majorVersion = $_.Name.split(".")[0] 6 | $fullVersion = $_.Name.Replace("-", "+") 7 | $defaultJavaPath = $env:JAVA_HOME 8 | $javaPath = Get-Item env:JAVA_HOME_${majorVersion}_X64 9 | 10 | $defaultPostfix = ($javaPath.Value -eq $defaultJavaPath) ? " (default)" : "" 11 | $vendorName = ($_.FullName -like '*Java_Adopt_jdk*') ? "Adopt OpenJDK" : "Eclipse Temurin" 12 | 13 | [PSCustomObject] @{ 14 | "Version" = $fullVersion + $defaultPostfix 15 | "Vendor" = $vendorName 16 | "Environment Variable" = $javaPath.Name 17 | } 18 | } 19 | # Return all the vendors which are not Adopt, also look for version 12 of Adopt (Eclipse Temurin does not have this version) 20 | $versionsToReturn = $existingVersions | Where-Object {$_.Vendor -notlike "Adopt*" -or $_.Version.Split(".")[0] -eq 12} 21 | return $versionsToReturn 22 | } 23 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/base/apt-mock-remove.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | prefix=/usr/local/bin 4 | 5 | for tool in apt apt-get apt-fast apt-key;do 6 | sudo rm -f $prefix/$tool 7 | done 8 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/base/limits.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | echo 'session required pam_limits.so' >> /etc/pam.d/common-session 4 | echo 'session required pam_limits.so' >> /etc/pam.d/common-session-noninteractive 5 | echo 'DefaultLimitNOFILE=65536' >> /etc/systemd/system.conf 6 | echo 'DefaultLimitSTACK=16M:infinity' >> /etc/systemd/system.conf 7 | 8 | # Raise Number of File Descriptors 9 | echo '* soft nofile 65536' >> /etc/security/limits.conf 10 | echo '* hard nofile 65536' >> /etc/security/limits.conf 11 | 12 | # Double stack size from default 8192KB 13 | echo '* soft stack 16384' >> /etc/security/limits.conf 14 | echo '* hard stack 16384' >> /etc/security/limits.conf 15 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/base/reboot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: reboot.sh 4 | ## Desc: Reboot VM 5 | ################################################################################ 6 | 7 | echo "Reboot VM" 8 | sudo reboot 9 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/base/repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: repos.sh 4 | ## Desc: Installs official Microsoft package repos for the distribution 5 | ################################################################################ 6 | 7 | LSB_RELEASE=$(lsb_release -rs) 8 | 9 | # Install Microsoft repository 10 | wget https://packages.microsoft.com/config/ubuntu/$LSB_RELEASE/packages-microsoft-prod.deb 11 | dpkg -i packages-microsoft-prod.deb 12 | 13 | # update 14 | apt-get install -y apt-transport-https ca-certificates curl software-properties-common 15 | apt-get -yq update 16 | apt-get -yq dist-upgrade 17 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/base/snap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Put snapd auto refresh on hold 4 | # as it may generate too much traffic on Canonical's snap server 5 | # when they are rolling a new major update out. 6 | # Hold is calculated as today's date + 60 days 7 | 8 | # snapd is started automatically, but during image generation 9 | # a unix socket may die, restart snapd.service (and therefore snapd.socket) 10 | # to make sure the socket is alive. 11 | 12 | systemctl restart snapd.socket 13 | systemctl restart snapd 14 | snap set system refresh.hold="$(date --date='today+60 days' +%Y-%m-%dT%H:%M:%S%:z)" 15 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/helpers/invoke-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: invoke-tests.sh 4 | ## Desc: Helper function for invoking tests 5 | ################################################################################ 6 | 7 | pwsh -Command "Import-Module '$HELPER_SCRIPTS/Tests.Helpers.psm1' -DisableNameChecking 8 | Invoke-PesterTests -TestFile \"$1\" -TestName \"$2\"" 9 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/helpers/os.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: install-helpers.sh 4 | ## Desc: Helper functions for installing tools 5 | ################################################################################ 6 | 7 | function isUbuntu18 8 | { 9 | lsb_release -d | grep -q 'Ubuntu 18' 10 | } 11 | 12 | function isUbuntu20 13 | { 14 | lsb_release -d | grep -q 'Ubuntu 20' 15 | } 16 | 17 | function isUbuntu22 18 | { 19 | lsb_release -d | grep -q 'Ubuntu 22' 20 | } 21 | 22 | function getOSVersionLabel 23 | { 24 | lsb_release -cs 25 | } -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/Install-PowerShellModules.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | $ProgressPreference = "SilentlyContinue" 3 | 4 | Import-Module "$env:HELPER_SCRIPTS/Tests.Helpers.psm1" -DisableNameChecking 5 | 6 | # Specifies the installation policy 7 | Set-PSRepository -InstallationPolicy Trusted -Name PSGallery 8 | 9 | # Try to update PowerShellGet before the actual installation 10 | Install-Module -Name PowerShellGet -Force 11 | Update-Module -Name PowerShellGet -Force 12 | 13 | # Install PowerShell modules 14 | $modules = (Get-ToolsetContent).powershellModules 15 | 16 | foreach($module in $modules) 17 | { 18 | $moduleName = $module.name 19 | Write-Host "Installing ${moduleName} module" 20 | 21 | if ($module.versions) 22 | { 23 | foreach ($version in $module.versions) 24 | { 25 | Write-Host " - $version" 26 | Install-Module -Name $moduleName -RequiredVersion $version -Scope AllUsers -SkipPublisherCheck -Force 27 | } 28 | continue 29 | } 30 | 31 | Install-Module -Name $moduleName -Scope AllUsers -SkipPublisherCheck -Force 32 | } 33 | 34 | Invoke-PesterTests -TestFile "PowerShellModules" -TestName "PowerShellModules" 35 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/aliyun-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: aliyun-cli.sh 4 | ## Desc: Installs Alibaba Cloud CLI 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # Install Alibaba Cloud CLI 11 | downloadUrl="https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz" 12 | download_with_retries $downloadUrl "/tmp" 13 | tar xzf /tmp/aliyun-cli-linux-*-amd64.tgz 14 | mv aliyun /usr/local/bin 15 | 16 | invoke_tests "CLI.Tools" "Aliyun CLI" 17 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/apache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: apache.sh 4 | ## Desc: Installs Apache HTTP Server 5 | ################################################################################ 6 | 7 | # Install Apache 8 | apt-get install apache2 -y 9 | 10 | # Disable apache2.service 11 | systemctl is-active --quiet apache2.service && systemctl stop apache2.service 12 | systemctl disable apache2.service 13 | 14 | invoke_tests "WebServers" "Apache" 15 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/aws.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: aws.sh 4 | ## Desc: Installs the AWS CLI, Session Manager plugin for the AWS CLI, and AWS SAM CLI 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/os.sh 9 | source $HELPER_SCRIPTS/install.sh 10 | 11 | download_with_retries "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" "/tmp" "awscliv2.zip" 12 | unzip -qq /tmp/awscliv2.zip -d /tmp 13 | /tmp/aws/install -i /usr/local/aws-cli -b /usr/local/bin 14 | 15 | download_with_retries "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" "/tmp" "session-manager-plugin.deb" 16 | apt install /tmp/session-manager-plugin.deb 17 | 18 | # Download & install the latest aws sam cli release 19 | zipName="aws-sam-cli-linux-x86_64.zip" 20 | zipUrl="https://github.com/aws/aws-sam-cli/releases/latest/download/${zipName}" 21 | download_with_retries $zipUrl "/tmp" $zipName 22 | unzip /tmp/${zipName} -d /tmp 23 | /tmp/install 24 | 25 | invoke_tests "CLI.Tools" "AWS" 26 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/azcopy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: azcopy.sh 4 | ## Desc: Installs AzCopy 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Install AzCopy10 10 | download_with_retries "https://aka.ms/downloadazcopy-v10-linux" "/tmp" "azcopy.tar.gz" 11 | tar xzf /tmp/azcopy.tar.gz --strip-components=1 -C /tmp 12 | mv /tmp/azcopy /usr/local/bin/azcopy 13 | chmod +x /usr/local/bin/azcopy 14 | # Create azcopy 10 alias for backward compatibility 15 | ln -sf /usr/local/bin/azcopy /usr/local/bin/azcopy10 16 | 17 | invoke_tests "Tools" "azcopy" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/azure-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: azure-cli.sh 4 | ## Desc: Installed Azure CLI (az) 5 | ################################################################################ 6 | 7 | # Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) 8 | curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash 9 | echo "azure-cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt" >> $HELPER_SCRIPTS/apt-sources.txt 10 | rm -f /etc/apt/sources.list.d/azure-cli.list 11 | rm -f /etc/apt/sources.list.d/azure-cli.list.save 12 | 13 | invoke_tests "CLI.Tools" "Azure CLI" 14 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/azure-devops-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: azure-devops-cli.sh 4 | ## Desc: Installed Azure DevOps CLI (az devops) 5 | ################################################################################ 6 | 7 | # AZURE_EXTENSION_DIR shell variable defines where modules are installed 8 | # https://docs.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview 9 | export AZURE_EXTENSION_DIR=/opt/az/azcliextensions 10 | echo "AZURE_EXTENSION_DIR=$AZURE_EXTENSION_DIR" | tee -a /etc/environment 11 | 12 | # install azure devops Cli extension 13 | az extension add -n azure-devops 14 | 15 | invoke_tests "CLI.Tools" "Azure DevOps CLI" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/basic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: basic.sh 4 | ## Desc: Installs basic command line utilities and dev packages 5 | ################################################################################ 6 | source $HELPER_SCRIPTS/install.sh 7 | 8 | common_packages=$(get_toolset_value .apt.common_packages[]) 9 | cmd_packages=$(get_toolset_value .apt.cmd_packages[]) 10 | for package in $common_packages $cmd_packages; do 11 | echo "Install $package" 12 | apt-get install -y --no-install-recommends $package 13 | done 14 | 15 | invoke_tests "Apt" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/bazel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: bazel.sh 4 | ## Desc: Installs Bazel and Bazelisk (A user-friendly launcher for Bazel) 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Install bazelisk 10 | npm install -g @bazel/bazelisk 11 | 12 | # run bazelisk once in order to instal /usr/local/bin/bazel binary 13 | sudo -u $SUDO_USER bazel version 14 | 15 | invoke_tests "Tools" "Bazel" 16 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/bicep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: bicep.sh 4 | ## Desc: Installs bicep cli 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Install Bicep CLI 10 | download_with_retries "https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64" "." "bicep.bin" 11 | # Mark it as executable 12 | chmod +x ./bicep.bin 13 | # Add bicep to PATH (requires admin) 14 | sudo mv ./bicep.bin /usr/local/bin/bicep 15 | 16 | invoke_tests "Tools" "Bicep" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # before cleanup 4 | before=$(df / -Pm | awk 'NR==2{print $4}') 5 | 6 | # clears out the local repository of retrieved package files 7 | # It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial 8 | apt-get clean 9 | rm -rf /tmp/* 10 | rm -rf /root/.cache 11 | 12 | # journalctl 13 | if command -v journalctl; then 14 | journalctl --rotate 15 | journalctl --vacuum-time=1s 16 | fi 17 | 18 | # delete all .gz and rotated file 19 | find /var/log -type f -regex ".*\.gz$" -delete 20 | find /var/log -type f -regex ".*\.[0-9]$" -delete 21 | 22 | # wipe log files 23 | find /var/log/ -type f -exec cp /dev/null {} \; 24 | 25 | # after cleanup 26 | after=$(df / -Pm | awk 'NR==2{print $4}') 27 | 28 | # display size 29 | echo "Before: $before MB" 30 | echo "After : $after MB" 31 | echo "Delta : $(($after-$before)) MB" 32 | 33 | # delete symlink for tests running 34 | rm -f /usr/local/bin/invoke_tests -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/cmake.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: cmake.sh 4 | ## Desc: Installs CMake 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # Test to see if the software in question is already installed, if not install it 11 | echo "Checking to see if the installer script has already been run" 12 | if command -v cmake; then 13 | echo "cmake is already installed" 14 | else 15 | downloadUrl=$(get_github_package_download_url "Kitware/CMake" "endswith(\"inux-x86_64.sh\")") 16 | curl -sL ${downloadUrl} -o cmakeinstall.sh \ 17 | && chmod +x cmakeinstall.sh \ 18 | && ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \ 19 | && rm cmakeinstall.sh 20 | fi 21 | 22 | invoke_tests "Tools" "Cmake" 23 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/complete-snap-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: snap-environment.sh 4 | ## Desc: Update /etc/environment to include /snap/bin in PATH 5 | ## because /etc/profile.d is ignored by `--norc` shell launch option 6 | ################################################################################ 7 | 8 | # Source the helpers 9 | source $HELPER_SCRIPTS/etc-environment.sh 10 | 11 | # Update /etc/environemnt 12 | prependEtcEnvironmentPath "/snap/bin" 13 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/docker-compose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: docker-compose.sh 4 | ## Desc: Installs Docker Compose 5 | ################################################################################ 6 | 7 | # Install docker-compose v1 from releases 8 | URL="https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64" 9 | curl -L $URL -o /usr/local/bin/docker-compose 10 | chmod +x /usr/local/bin/docker-compose 11 | 12 | invoke_tests "Tools" "Docker-compose v1" 13 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/dpkg-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # This is the anti-frontend. It never interacts with you at all, 4 | # and makes the default answers be used for all questions. It 5 | # might mail error messages to root, but that's it; otherwise it 6 | # is completely silent and unobtrusive, a perfect frontend for 7 | # automatic installs. If you are using this front-end, and require 8 | # non-default answers to questions, you will need to preseed the 9 | # debconf database 10 | echo 'DEBIAN_FRONTEND=noninteractive' | tee -a /etc/environment 11 | 12 | # dpkg can be instructed not to ask for confirmation 13 | # when replacing a configuration file (with the --force-confdef --force-confold options) 14 | cat <> /etc/apt/apt.conf.d/10dpkg-options 15 | Dpkg::Options { 16 | "--force-confdef"; 17 | "--force-confold"; 18 | } 19 | EOF 20 | 21 | # hide information about packages that are no longer required 22 | cat <> /etc/apt/apt.conf.d/10apt-autoremove 23 | APT::Get::AutomaticRemove "0"; 24 | APT::Get::HideAutoRemove "1"; 25 | EOF 26 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/erlang.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: erlang.sh 4 | ## Desc: Installs erlang 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | source_list=/etc/apt/sources.list.d/eslerlang.list 11 | source_key=/usr/share/keyrings/eslerlang.gpg 12 | 13 | # Install Erlang 14 | wget -q -O - https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | gpg --dearmor > $source_key 15 | echo "deb [signed-by=$source_key] https://packages.erlang-solutions.com/ubuntu $(lsb_release -cs) contrib" > $source_list 16 | apt-get update 17 | apt-get install -y --no-install-recommends esl-erlang 18 | 19 | # Install rebar3 20 | rebar3_url="https://github.com/erlang/rebar3/releases/latest/download/rebar3" 21 | download_with_retries $rebar3_url "/usr/local/bin" "rebar3" 22 | chmod +x /usr/local/bin/rebar3 23 | 24 | # Clean up source list 25 | rm $source_list 26 | rm $source_key 27 | 28 | invoke_tests "Tools" "erlang" 29 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/example.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: example.sh 4 | ## Desc: This is an example script that can be copied to add a new software 5 | ## installer to the image 6 | ################################################################################ 7 | 8 | # Test to see if the software in question is already installed, if not install it 9 | echo "Checking to see if the installer script has already been run" 10 | if [ -z $EXAMPLE_VAR ]; then 11 | $EXAMPLE_VAR=1.0.0 12 | else 13 | echo "Example variable already set to $EXAMPLE_VAR" 14 | fi 15 | 16 | # Run tests to determine that the software installed as expected 17 | echo "Testing to make sure that script performed as expected, and basic scenarios work" 18 | if [ -z $EXAMPLE_VAR ]; then 19 | echo "EXAMPLE_VAR variable was not set as expected" 20 | exit 1 21 | else 22 | echo "EXAMPLE_VAR was set properly" 23 | fi 24 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/firefox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: firefox.sh 4 | ## Desc: Installs Firefox 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # Install Firefox 11 | apt-get install -y firefox 12 | 13 | # add to gloabl system preferences for firefox locale en_US, because other browsers have en_US local. 14 | # Default firefox local is en_GB 15 | echo 'pref("intl.locale.requested","en_US");' >> "/usr/lib/firefox/browser/defaults/preferences/syspref.js" 16 | 17 | # Download and unpack latest release of geckodriver 18 | downloadUrl=$(get_github_package_download_url "mozilla/geckodriver" "test(\"linux64.tar.gz$\")") 19 | echo "Downloading geckodriver $downloadUrl" 20 | download_with_retries "$downloadUrl" "/tmp" geckodriver.tar.gz 21 | 22 | GECKODRIVER_DIR="/usr/local/share/gecko_driver" 23 | GECKODRIVER_BIN="$GECKODRIVER_DIR/geckodriver" 24 | 25 | mkdir -p $GECKODRIVER_DIR 26 | tar -xzf /tmp/geckodriver.tar.gz -C $GECKODRIVER_DIR 27 | 28 | chmod +x $GECKODRIVER_BIN 29 | ln -s "$GECKODRIVER_BIN" /usr/bin/ 30 | echo "GECKOWEBDRIVER=$GECKODRIVER_DIR" | tee -a /etc/environment 31 | 32 | invoke_tests "Browsers" "Firefox" 33 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: gcc.sh 4 | ## Desc: Installs GNU C++ 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/os.sh 9 | source $HELPER_SCRIPTS/install.sh 10 | 11 | function InstallGcc { 12 | version=$1 13 | 14 | echo "Installing $version..." 15 | apt-get install $version -y 16 | } 17 | 18 | # Install GNU C++ compiler 19 | add-apt-repository ppa:ubuntu-toolchain-r/test -y 20 | apt-get update -y 21 | 22 | versions=$(get_toolset_value '.gcc.versions[]') 23 | 24 | for version in ${versions[*]}; do 25 | InstallGcc $version 26 | done 27 | 28 | invoke_tests "Tools" "gcc" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/gfortran.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: gfortran.sh 4 | ## Desc: Installs GNU Fortran 5 | ################################################################################ 6 | source $HELPER_SCRIPTS/install.sh 7 | source $HELPER_SCRIPTS/os.sh 8 | 9 | function InstallFortran { 10 | version=$1 11 | 12 | echo "Installing $version..." 13 | apt-get install $version -y 14 | } 15 | 16 | # Install GNU Fortran compiler 17 | add-apt-repository ppa:ubuntu-toolchain-r/test -y 18 | apt-get update -y 19 | 20 | versions=$(get_toolset_value '.gfortran.versions[]') 21 | 22 | for version in ${versions[*]} 23 | do 24 | InstallFortran $version 25 | done 26 | 27 | invoke_tests "Tools" "gfortran" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/github-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: github-cli.sh 4 | ## Desc: Installs GitHub CLI 5 | ## Must be run as non-root user after homebrew 6 | ################################################################################ 7 | 8 | # Source the helpers for use with the script 9 | source $HELPER_SCRIPTS/install.sh 10 | 11 | # Install GitHub CLI 12 | downloadUrl=$(get_github_package_download_url "cli/cli" "contains(\"linux\") and contains(\"amd64\") and contains(\".deb\")") 13 | download_with_retries $downloadUrl "/tmp" 14 | apt install /tmp/gh_*_linux_amd64.deb 15 | 16 | invoke_tests "CLI.Tools" "GitHub CLI" 17 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/google-cloud-sdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: google-cloud-sdk.sh 4 | ## Desc: Installs the Google Cloud SDK 5 | ################################################################################ 6 | 7 | REPO_URL="https://packages.cloud.google.com/apt" 8 | 9 | # Install the Google Cloud SDK 10 | echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] $REPO_URL cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list 11 | wget -q https://packages.cloud.google.com/apt/doc/apt-key.gpg -O /usr/share/keyrings/cloud.google.gpg 12 | apt-get update -y 13 | # temporary downgrade google-cloud-sdk as python component has linking bugs 14 | apt-get install -y google-cloud-sdk=369.0.0-0 15 | 16 | # remove apt 17 | rm /etc/apt/sources.list.d/google-cloud-sdk.list 18 | rm /usr/share/keyrings/cloud.google.gpg 19 | 20 | # add repo to the apt-sources.txt 21 | echo "google-cloud-sdk $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt 22 | 23 | invoke_tests "CLI.Tools" "Google Cloud SDK" 24 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/graalvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | source $HELPER_SCRIPTS/install.sh 4 | source $HELPER_SCRIPTS/etc-environment.sh 5 | 6 | # Install GraalVM 7 | GRAALVM_ROOT=/usr/local/graalvm 8 | export GRAALVM_11_ROOT=$GRAALVM_ROOT/graalvm-ce-java11* 9 | 10 | downloadUrl=$(get_github_package_download_url "graalvm/graalvm-ce-builds" "contains(\"graalvm-ce-java11-linux-amd64\") and endswith(\"tar.gz\")") 11 | download_with_retries "$downloadUrl" "/tmp" "graalvm-archive.tar.gz" 12 | mkdir $GRAALVM_ROOT 13 | tar -xzf "/tmp/graalvm-archive.tar.gz" -C $GRAALVM_ROOT 14 | 15 | # Set environment variable for GraalVM root 16 | setEtcEnvironmentVariable "GRAALVM_11_ROOT" $GRAALVM_11_ROOT 17 | 18 | # Install Native Image 19 | $GRAALVM_11_ROOT/bin/gu install native-image 20 | 21 | invoke_tests "Tools" "GraalVM" 22 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/heroku.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: heroku.sh 4 | ## Desc: Installs Heroku CLI 5 | ################################################################################ 6 | 7 | # Install Heroku CLI 8 | curl https://cli-assets.heroku.com/install.sh | sh 9 | 10 | invoke_tests "Tools" "Heroku" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/hhvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: hhvm.sh 4 | ## Desc: Installs hhvm 5 | ################################################################################ 6 | 7 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 8 | add-apt-repository https://dl.hhvm.com/ubuntu 9 | apt-get update 10 | apt-get -qq install -y hhvm 11 | 12 | invoke_tests "Tools" "HHVM" 13 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/julia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: julia.sh 4 | ## Desc: Installs Julia, and adds Julia to the path 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # get the latest julia version 11 | json=$(curl -sL "https://julialang-s3.julialang.org/bin/versions.json") 12 | julia_version=$(echo $json | jq -r '.[].files[] | select(.triplet=="x86_64-linux-gnu" and (.version | contains("-") | not)).version' | sort -V | tail -n1) 13 | 14 | # download julia archive 15 | julia_tar_url=$(echo $json | jq -r ".[].files[].url | select(endswith(\"julia-${julia_version}-linux-x86_64.tar.gz\"))") 16 | julia_tar_name="julia-${julia_version}-linux-x86_64.tar.gz" 17 | download_with_retries $julia_tar_url "/tmp" "${julia_tar_name}" 18 | 19 | # extract files and make symlink 20 | julia_tar_tmp="/tmp/${julia_tar_name}" 21 | julia_installation_path="/usr/local/julia${julia_version}" 22 | mkdir -p "${julia_installation_path}" 23 | tar -C "${julia_installation_path}" -xzf "${julia_tar_tmp}" --strip-components=1 24 | ln -s "${julia_installation_path}/bin/julia" /usr/bin/julia 25 | rm "${julia_tar_tmp}" 26 | 27 | invoke_tests "Tools" "Julia" 28 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/kotlin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: kotlin.sh 4 | ## Desc: Installs Kotlin 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | KOTLIN_ROOT="/usr/share" 10 | downloadUrl=$(get_github_package_download_url "JetBrains/kotlin" "contains(\"kotlin-compiler\")") 11 | download_with_retries "$downloadUrl" "/tmp" 12 | 13 | unzip -qq /tmp/kotlin-compiler*.zip -d $KOTLIN_ROOT 14 | rm $KOTLIN_ROOT/kotlinc/bin/*.bat 15 | ln -sf $KOTLIN_ROOT/kotlinc/bin/* /usr/bin 16 | 17 | invoke_tests "Tools" "Kotlin" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/leiningen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: leiningen.sh 4 | ## Desc: Installs Leiningen 5 | ################################################################################ 6 | 7 | LEIN_BIN=/usr/local/bin/lein 8 | curl -s https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN 9 | chmod 0755 $LEIN_BIN 10 | 11 | # Run lein to trigger self-install 12 | export LEIN_HOME=/usr/local/lib/lein 13 | lein 14 | 15 | LEIN_JAR=$(find $LEIN_HOME -name "leiningen-*-standalone.jar") 16 | echo "LEIN_JAR=$LEIN_JAR" | tee -a /etc/environment 17 | echo "LEIN_HOME=$LEIN_HOME" | tee -a /etc/environment 18 | 19 | invoke_tests "Tools" "Leiningen" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/miniconda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: miniconda.sh 4 | ## Desc: Installs miniconda 5 | ################################################################################ 6 | 7 | # Install Miniconda 8 | curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \ 9 | && chmod +x miniconda.sh \ 10 | && ./miniconda.sh -b -p /usr/share/miniconda \ 11 | && rm miniconda.sh 12 | 13 | CONDA=/usr/share/miniconda 14 | echo "CONDA=$CONDA" | tee -a /etc/environment 15 | 16 | ln -s $CONDA/bin/conda /usr/bin/conda 17 | 18 | invoke_tests "Tools" "Conda" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/mongodb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: homebrew.sh 4 | ## Desc: Installs Mongo DB 5 | ################################################################################ 6 | 7 | # Source the helpers 8 | source $HELPER_SCRIPTS/os.sh 9 | source $HELPER_SCRIPTS/install.sh 10 | 11 | REPO_URL="https://repo.mongodb.org/apt/ubuntu" 12 | osLabel=$(getOSVersionLabel) 13 | toolsetVersion=$(get_toolset_value '.mongodb.version') 14 | latestVersion=$(curl $REPO_URL/dists/$osLabel/mongodb-org/ | awk -F'>|<' '{print $3}' | grep "^$toolsetVersion" | tail -1) 15 | 16 | # Install Mongo DB 17 | wget -qO - https://www.mongodb.org/static/pgp/server-$latestVersion.asc | sudo apt-key add - 18 | 19 | echo "deb [ arch=amd64,arm64 ] $REPO_URL $osLabel/mongodb-org/$latestVersion multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$latestVersion.list 20 | sudo apt-get update 21 | sudo apt-get install -y mongodb-org 22 | 23 | rm /etc/apt/sources.list.d/mongodb-org-$latestVersion.list 24 | 25 | echo "mongodb $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt 26 | 27 | invoke_tests "Databases" "MongoDB" 28 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/mssql-cmd-tools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: mssql-cmd-tools.sh 4 | ## Desc: Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017) 5 | ################################################################################ 6 | 7 | export ACCEPT_EULA=Y 8 | 9 | apt-get update 10 | apt-get install -y mssql-tools unixodbc-dev 11 | apt-get -f install 12 | ln -s /opt/mssql-tools/bin/* /usr/local/bin/ 13 | 14 | invoke_tests "Tools" "MSSQLCommandLineTools" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: mysql.sh 4 | ## Desc: Installs MySQL Client 5 | ################################################################################ 6 | 7 | source /etc/os-release 8 | source $HELPER_SCRIPTS/os.sh 9 | 10 | # Mysql setting up root password 11 | MYSQL_ROOT_PASSWORD=root 12 | echo "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD" | debconf-set-selections 13 | echo "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD" | debconf-set-selections 14 | 15 | export ACCEPT_EULA=Y 16 | 17 | # Install MySQL Client 18 | apt-get install mysql-client -y 19 | 20 | # Install MySQL Server 21 | apt-get install -y mysql-server 22 | 23 | #Install MySQL Dev tools 24 | apt install libmysqlclient-dev -y 25 | 26 | # Disable mysql.service 27 | systemctl is-active --quiet mysql.service && systemctl stop mysql.service 28 | systemctl disable mysql.service 29 | 30 | invoke_tests "Databases" "MySQL" 31 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: nginx.sh 4 | ## Desc: Installs Nginx 5 | ################################################################################ 6 | 7 | # Install Nginx 8 | apt-get install nginx -y 9 | 10 | # Disable nginx.service 11 | systemctl is-active --quiet nginx.service && systemctl stop nginx.service 12 | systemctl disable nginx.service 13 | 14 | invoke_tests "WebServers" "Nginx" 15 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: nodejs.sh 4 | ## Desc: Installs Node.js LTS and related tooling (Gulp, Grunt) 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # Install default Node.js 11 | defaultVersion=$(get_toolset_value '.node.default') 12 | curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n 13 | bash ~/n $defaultVersion 14 | 15 | # Install node modules 16 | node_modules=$(get_toolset_value '.node_modules[].name') 17 | npm install -g $node_modules 18 | 19 | echo "Creating the symlink for [now] command to vercel CLI" 20 | ln -s /usr/local/bin/vercel /usr/local/bin/now 21 | 22 | # fix global modules installation as regular user 23 | # related issue https://github.com/actions/virtual-environments/issues/3727 24 | sudo chmod -R 777 /usr/local/lib/node_modules 25 | sudo chmod -R 777 /usr/local/bin 26 | 27 | rm -rf ~/n 28 | 29 | invoke_tests "Node" "Node.js" 30 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/nvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: nvm.sh 4 | ## Desc: Installs Nvm 5 | ################################################################################ 6 | 7 | export NVM_DIR="/etc/skel/.nvm" 8 | mkdir $NVM_DIR 9 | VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name') 10 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash 11 | echo 'NVM_DIR=$HOME/.nvm' | tee -a /etc/environment 12 | echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile 13 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 14 | 15 | invoke_tests "Tools" "nvm" 16 | 17 | # set system node.js as default one 18 | nvm alias default system 19 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/oc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: oc.sh 4 | ## Desc: Installs the OC CLI 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Install the oc CLI 10 | DOWNLOAD_URL="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz" 11 | PACKAGE_TAR_NAME="oc.tar.gz" 12 | download_with_retries $DOWNLOAD_URL "/tmp" $PACKAGE_TAR_NAME 13 | tar xzf "/tmp/$PACKAGE_TAR_NAME" -C "/usr/local/bin" oc 14 | 15 | invoke_tests "CLI.Tools" "OC CLI" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/oras-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: oras-cli.sh 4 | ## Desc: Installs ORAS CLI 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Determine latest ORAS CLI version 10 | ORAS_CLI_DOWNLOAD_URL=$(get_github_package_download_url "oras-project/oras" "endswith(\"linux_amd64.tar.gz\")") 11 | ORAS_CLI_ARCHIVE=$(basename $ORAS_CLI_DOWNLOAD_URL) 12 | 13 | # Install ORAS CLI 14 | cd /tmp 15 | download_with_retries $ORAS_CLI_DOWNLOAD_URL 16 | tar xzf $ORAS_CLI_ARCHIVE -C /usr/local/bin oras 17 | 18 | invoke_tests "CLI.Tools" "Oras CLI" 19 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/packer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: packer.sh 4 | ## Desc: Installs packer 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Install Packer 10 | URL=$(curl -s https://api.releases.hashicorp.com/v1/releases/packer/latest | jq -r '.builds[] | select((.arch=="amd64") and (.os=="linux")).url') 11 | ZIP_NAME="packer_linux_amd64.zip" 12 | download_with_retries "${URL}" "/tmp" "${ZIP_NAME}" 13 | unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin 14 | rm -f "/tmp/${ZIP_NAME}" 15 | 16 | invoke_tests "Tools" "Packer" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/phantomjs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: phantomjs.sh 4 | ## Desc: Installs PhantomJS 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # Install PhantomJS 11 | apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev 12 | PHANTOM_JS=phantomjs-2.1.1-linux-x86_64 13 | download_with_retries https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 "/tmp" 14 | tar xjf /tmp/$PHANTOM_JS.tar.bz2 -C /usr/local/share 15 | ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin 16 | 17 | invoke_tests "Tools" "Phantomjs" 18 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/pipx-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: pipx-packages.sh 4 | ## Desc: Install tools via pipx 5 | ################################################################################ 6 | source $HELPER_SCRIPTS/install.sh 7 | 8 | export PATH="$PATH:/opt/pipx_bin" 9 | 10 | pipx_packages=$(get_toolset_value ".pipx[] .package") 11 | 12 | for package in $pipx_packages; do 13 | python_version=$(get_toolset_value ".pipx[] | select(.package == \"$package\") .python") 14 | if [ "$python_version" != "null" ]; then 15 | python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" 16 | echo "Install $package into python $python_path" 17 | pipx install $package --python $python_path 18 | else 19 | echo "Install $package into default python" 20 | pipx install $package 21 | 22 | # https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html 23 | # Install ansible into an existing ansible-core Virtual Environment 24 | if [[ $package == "ansible-core" ]]; then 25 | pipx inject $package ansible 26 | fi 27 | fi 28 | 29 | done 30 | 31 | invoke_tests "Common" "PipxPackages" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/post-deployment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: post-deployment.sh 4 | ## Desc: Post deployment actions 5 | ################################################################################ 6 | 7 | mv -f /imagegeneration/post-generation /opt 8 | 9 | echo "chmod -R 777 /opt" 10 | chmod -R 777 /opt 11 | echo "chmod -R 777 /usr/share" 12 | chmod -R 777 /usr/share 13 | 14 | # remove installer and helper folders 15 | rm -rf $HELPER_SCRIPT_FOLDER 16 | rm -rf $INSTALLER_SCRIPT_FOLDER 17 | chmod 755 $IMAGE_FOLDER 18 | 19 | # Remove quotes around PATH 20 | ENVPATH=$(grep 'PATH=' /etc/environment | head -n 1 | sed -z 's/^PATH=*//') 21 | ENVPATH=${ENVPATH#"\""} 22 | ENVPATH=${ENVPATH%"\""} 23 | echo "PATH=$ENVPATH" | sudo tee -a /etc/environment 24 | echo "Updated /etc/environment: $(cat /etc/environment)" 25 | 26 | # Clean yarn and npm cache 27 | yarn cache clean 28 | npm cache clean --force 29 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/powershellcore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: powershellcore.sh 4 | ## Desc: Installs powershellcore 5 | ################################################################################ 6 | 7 | # Install Powershell 8 | apt-get install -y powershell 9 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/preimagedata.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | imagedata_file=$IMAGEDATA_FILE 4 | image_version=$IMAGE_VERSION 5 | os_name=$(lsb_release -ds | sed "s/ /\\\n/g") 6 | os_version=$(lsb_release -rs) 7 | image_label="ubuntu-${os_version}" 8 | version_major=${os_version/.*/} 9 | version_wo_dot=${os_version/./} 10 | github_url="https://github.com/actions/virtual-environments/blob" 11 | 12 | software_url="${github_url}/ubuntu${version_major}/${image_version}/images/linux/Ubuntu${version_wo_dot}-Readme.md" 13 | releaseUrl="https://github.com/actions/virtual-environments/releases/tag/ubuntu${version_major}%2F${image_version}" 14 | 15 | cat < $imagedata_file 16 | [ 17 | { 18 | "group": "Operating System", 19 | "detail": "${os_name}" 20 | }, 21 | { 22 | "group": "Virtual Environment", 23 | "detail": "Environment: ${image_label}\nVersion: ${image_version}\nIncluded Software: ${software_url}\nImage Release: ${releaseUrl}" 24 | } 25 | ] 26 | EOF 27 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/pulumi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: pulumi.sh 4 | ## Desc: Installs Pulumi 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # Install Pulumi 11 | VERSION=$(curl --fail --silent -L "https://www.pulumi.com/latest-version") 12 | TARBALL_URL="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-linux-x64.tar.gz" 13 | download_with_retries ${TARBALL_URL} "/tmp" pulumi-v${VERSION}.tar.gz 14 | tar --strip=1 -xf /tmp/pulumi-v${VERSION}.tar.gz -C /usr/local/bin 15 | 16 | invoke_tests "Tools" "Pulumi" 17 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/r.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Source the helpers for use with the script 4 | source $HELPER_SCRIPTS/os.sh 5 | 6 | # install R 7 | osLabel=$(getOSVersionLabel) 8 | 9 | wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | gpg --dearmor > /usr/share/keyrings/rlang.gpg 10 | echo "deb [signed-by=/usr/share/keyrings/rlang.gpg] https://cloud.r-project.org/bin/linux/ubuntu $osLabel-cran40/" > /etc/apt/sources.list.d/rlang.list 11 | 12 | apt-get update 13 | apt-get install r-base 14 | 15 | rm /etc/apt/sources.list.d/rlang.list 16 | rm /usr/share/keyrings/rlang.gpg 17 | 18 | invoke_tests "Tools" "R" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/rust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: rust.sh 4 | ## Desc: Installs Rust 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/etc-environment.sh 9 | source $HELPER_SCRIPTS/os.sh 10 | 11 | export RUSTUP_HOME=/etc/skel/.rustup 12 | export CARGO_HOME=/etc/skel/.cargo 13 | 14 | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=stable --profile=minimal 15 | 16 | # Initialize environment variables 17 | source $CARGO_HOME/env 18 | 19 | # Install common tools 20 | rustup component add rustfmt clippy 21 | 22 | if isUbuntu22; then 23 | cargo install bindgen cbindgen cargo-audit cargo-outdated 24 | else 25 | cargo install --locked bindgen cbindgen cargo-audit cargo-outdated 26 | fi 27 | 28 | # Cleanup Cargo cache 29 | rm -rf ${CARGO_HOME}/registry/* 30 | 31 | # Update /etc/environemnt 32 | prependEtcEnvironmentPath '$HOME/.cargo/bin' 33 | 34 | invoke_tests "Tools" "Rust" 35 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/sbt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: scala.sh 4 | ## Desc: Installs sbt 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Install latest sbt release 10 | downloadUrl=$(get_github_package_download_url "sbt/sbt" "endswith(\".tgz\")") 11 | download_with_retries "$downloadUrl" "/tmp" "sbt.tgz" 12 | tar zxf /tmp/sbt.tgz -C /usr/share 13 | ln -s /usr/share/sbt/bin/sbt /usr/bin/sbt 14 | 15 | invoke_tests "Tools" "Sbt" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/selenium.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: selenium.sh 4 | ## Desc: Installs selenium server 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | 10 | # Download Selenium server 11 | SELENIUM_MAJOR_VERSION=$(get_toolset_value '.selenium.version') 12 | SELENIUM_BINARY_NAME=$(get_toolset_value '.selenium.binary_name') 13 | SELENIUM_JAR_PATH="/usr/share/java" 14 | SELENIUM_JAR_NAME="$SELENIUM_BINARY_NAME.jar" 15 | SELENIUM_DOWNLOAD_URL=$(get_github_package_download_url "SeleniumHQ/selenium" "contains(\"${SELENIUM_BINARY_NAME}-${SELENIUM_MAJOR_VERSION}\") and endswith(\".jar\")") 16 | download_with_retries $SELENIUM_DOWNLOAD_URL $SELENIUM_JAR_PATH $SELENIUM_JAR_NAME 17 | 18 | # Create an epmty file to retrive selenium version 19 | SELENIUM_FULL_VERSION=$(echo $SELENIUM_DOWNLOAD_URL | awk -F"${SELENIUM_BINARY_NAME}-|.jar" '{print $2}') 20 | touch "$SELENIUM_JAR_PATH/$SELENIUM_BINARY_NAME-$SELENIUM_FULL_VERSION" 21 | 22 | # Add SELENIUM_JAR_PATH environment variable 23 | echo "SELENIUM_JAR_PATH=$SELENIUM_JAR_PATH/$SELENIUM_JAR_NAME" | tee -a /etc/environment 24 | 25 | invoke_tests "Tools" "Selenium" 26 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/sphinx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: sphinx.sh 4 | ## Desc: Installs Sphinx 5 | ################################################################################ 6 | 7 | 8 | # Install Sphinx 9 | apt-get install -y sphinxsearch 10 | 11 | invoke_tests "Tools" "Sphinx" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/sqlpackage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: sqlpackage.sh 4 | ## Desc: Install SqlPackage CLI to DacFx (https://docs.microsoft.com/sql/tools/sqlpackage/sqlpackage-download#get-sqlpackage-net-core-for-linux) 5 | ################################################################################ 6 | 7 | # Source the helpers for use with the script 8 | source $HELPER_SCRIPTS/install.sh 9 | source $HELPER_SCRIPTS/os.sh 10 | 11 | # Install libssl1.1 dependency 12 | if isUbuntu22; then 13 | download_with_retries "http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb" "/tmp" 14 | dpkg -i /tmp/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb 15 | fi 16 | 17 | # Install SqlPackage 18 | download_with_retries "https://aka.ms/sqlpackage-linux" "." "sqlpackage.zip" 19 | 20 | unzip -qq sqlpackage.zip -d /usr/local/sqlpackage 21 | rm -f sqlpackage.zip 22 | chmod +x /usr/local/sqlpackage/sqlpackage 23 | ln -sf /usr/local/sqlpackage/sqlpackage /usr/local/bin 24 | 25 | invoke_tests "Tools" "SqlPackage" 26 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/terraform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: terraform.sh 4 | ## Desc: Installs terraform 5 | ################################################################################ 6 | 7 | source $HELPER_SCRIPTS/install.sh 8 | 9 | # Install Terraform 10 | URL=$(curl -s https://api.releases.hashicorp.com/v1/releases/terraform/latest | jq -r '.builds[] | select((.arch=="amd64") and (.os=="linux")).url') 11 | ZIP_NAME="terraform_linux_amd64.zip" 12 | download_with_retries "${URL}" "/tmp" "${ZIP_NAME}" 13 | unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin 14 | rm -f "/tmp/${ZIP_NAME}" 15 | 16 | invoke_tests "Tools" "Terraform" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/validate-disk-space.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: validate-disk-space.sh 4 | ## Desc: Validate free disk space 5 | ################################################################################ 6 | 7 | availableSpaceMB=$(df / -hm | sed 1d | awk '{ print $4}') 8 | minimumFreeSpaceMB=15000 9 | 10 | echo "Available disk space: $availableSpaceMB MB" 11 | 12 | if [ $RUN_VALIDATION != "true" ]; then 13 | echo "Skipping validation disk space..." 14 | exit 0 15 | fi 16 | 17 | if [ $availableSpaceMB -le $minimumFreeSpaceMB ]; then 18 | echo "Not enough disk space on the image (minimum available space: $minimumFreeSpaceMB MB)" 19 | exit 1 20 | fi 21 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/vcpkg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | ################################################################################ 3 | ## File: vcpkg.sh 4 | ## Desc: Installs vcpkg 5 | ################################################################################ 6 | 7 | # Set env variable for vcpkg 8 | VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg 9 | echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environment 10 | 11 | # Install vcpkg 12 | git clone https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT 13 | 14 | $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh 15 | $VCPKG_INSTALLATION_ROOT/vcpkg integrate install 16 | chmod 0777 -R $VCPKG_INSTALLATION_ROOT 17 | ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin 18 | 19 | invoke_tests "Tools" "Vcpkg" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/installers/yq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Source the helpers for use with the script 4 | source $HELPER_SCRIPTS/install.sh 5 | 6 | YQ_URL="https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64" 7 | download_with_retries "$YQ_URL" "/usr/bin" "yq" 8 | chmod +x /usr/bin/yq 9 | 10 | invoke_tests "Tools" "yq" 11 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/tests/Browsers.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Firefox" -Skip:(Test-IsUbuntu22) { 2 | It "Firefox" { 3 | "sudo -i firefox --version" | Should -ReturnZeroExitCode 4 | } 5 | 6 | It "Geckodriver" { 7 | "geckodriver --version" | Should -ReturnZeroExitCode 8 | } 9 | } 10 | 11 | Describe "Chrome" { 12 | It "Chrome" { 13 | "google-chrome --version" | Should -ReturnZeroExitCode 14 | } 15 | 16 | It "Chrome Driver" { 17 | "chromedriver --version" | Should -ReturnZeroExitCode 18 | } 19 | } 20 | 21 | Describe "Edge" { 22 | It "Edge" { 23 | "microsoft-edge --version" | Should -ReturnZeroExitCode 24 | } 25 | 26 | It "Edge Driver" { 27 | "msedgedriver --version" | Should -ReturnZeroExitCode 28 | } 29 | } 30 | 31 | Describe "Chromium" { 32 | It "Chromium" { 33 | "chromium-browser --version" | Should -ReturnZeroExitCode 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/tests/Haskell.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Haskell" { 2 | $GHCCommonPath = "/usr/local/.ghcup/ghc" 3 | $GHCVersions = Get-ChildItem -Path $GHCCommonPath | Where-Object { $_.Name -match "\d+\.\d+" } 4 | 5 | $testCase = @{ GHCVersions = $GHCVersions } 6 | 7 | It "GHC directory contains two version of GHC" -TestCases $testCase { 8 | param ([object] $GHCVersions) 9 | $GHCVersions.Count | Should -Be 2 10 | } 11 | 12 | $testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} } 13 | 14 | It "GHC version " -TestCases $testCases { 15 | param ([string] $GHCPath) 16 | "$GHCPath --version" | Should -ReturnZeroExitCode 17 | } 18 | 19 | It "GHCup" { 20 | "ghcup --version" | Should -ReturnZeroExitCode 21 | } 22 | 23 | It "Default GHC" { 24 | "ghc --version" | Should -ReturnZeroExitCode 25 | } 26 | 27 | It "Cabal" { 28 | "cabal --version" | Should -ReturnZeroExitCode 29 | } 30 | 31 | It "Stack" { 32 | "stack --version" | Should -ReturnZeroExitCode 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/tests/Node.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Node.js" { 2 | $binaries = @("node") 3 | $module_commands = (Get-ToolsetContent).node_modules | ForEach-Object { $_.command } 4 | $testCases = $binaries + $module_commands | ForEach-Object { @{NodeCommand = $_} } 5 | 6 | It "" -TestCases $testCases { 7 | param ( 8 | [string] $NodeCommand 9 | ) 10 | 11 | "$NodeCommand --version" | Should -ReturnZeroExitCode 12 | } 13 | 14 | It "Node.js version should correspond to the version in the toolset" { 15 | node --version | Should -BeLike "v$((Get-ToolsetContent).node.default).*" 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/tests/RunAll-Tests.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking 2 | 3 | Invoke-PesterTests "*" -------------------------------------------------------------------------------- /.github-actions/images/linux/scripts/tests/WebServers.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Apache" { 2 | It "Apache CLI" { 3 | "apache2 -v" | Should -ReturnZeroExitCode 4 | } 5 | 6 | It "Apache Service" { 7 | "sudo systemctl start apache2" | Should -ReturnZeroExitCode 8 | "apachectl configtest" | Should -ReturnZeroExitCode 9 | "sudo systemctl stop apache2" | Should -ReturnZeroExitCode 10 | } 11 | } 12 | 13 | Describe "Nginx" { 14 | It "Nginx CLI" { 15 | "nginx -v" | Should -ReturnZeroExitCode 16 | } 17 | 18 | It "Nginx Service" { 19 | "sudo systemctl start nginx" | Should -ReturnZeroExitCode 20 | "sudo nginx -t" | Should -ReturnZeroExitCode 21 | "sudo systemctl stop nginx" | Should -ReturnZeroExitCode 22 | } 23 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/assets/select-xamarin-sdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | if [ -z "$1" ]; then 3 | echo "No Xamarin SDK specified." 4 | exit 0 5 | fi 6 | 7 | XAMARIN_SDK=$1 8 | 9 | echo "Set Xamarin SDK to ${XAMARIN_SDK}" 10 | FOLDERS_LIST=( 11 | '/Library/Frameworks/Mono.framework/Versions' 12 | '/Library/Frameworks/Xamarin.iOS.framework/Versions' 13 | '/Library/Frameworks/Xamarin.Android.framework/Versions' 14 | '/Library/Frameworks/Xamarin.Mac.framework/Versions' 15 | ) 16 | 17 | for FOLDER in "${FOLDERS_LIST[@]}" 18 | do 19 | echo "Set Current folder for ${FOLDER}" 20 | sudo rm -f ${FOLDER}/Current 21 | sudo ln -s ${FOLDER}/${XAMARIN_SDK} ${FOLDER}/Current 22 | done 23 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/bootstrap-provisioner/change_password: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | USERNAME="$1" 3 | OLD_PASSWD="$2" 4 | NEW_PASSWD="$3" 5 | UPDATE_LOGIN_KEYCHAIN="${4:-true}" 6 | 7 | sudo /usr/sbin/sysadminctl -resetPasswordFor $USERNAME -newPassword "$NEW_PASSWD" -adminUser $USERNAME -adminPassword "$OLD_PASSWD" 8 | sudo /usr/bin/python3 /Users/$USERNAME/bootstrap/kcpassword.py "$NEW_PASSWD" 9 | sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser "$USERNAME" 10 | 11 | if [[ $UPDATE_LOGIN_KEYCHAIN == "true" ]]; then 12 | /usr/bin/security set-keychain-password -o "$OLD_PASSWD" -p "$NEW_PASSWD" /Users/$USERNAME/Library/Keychains/login.keychain 13 | fi 14 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/bootstrap-provisioner/installNewProvisioner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | BOOTSTRAP_PATH="$1" 3 | ProvisionerPackageUri="$2" 4 | ProvisionerScriptUri="$3" 5 | ScriptName="$4" 6 | ScriptParam="$5" 7 | Username="$6" 8 | 9 | export PATH=/usr/bin:/usr/sbin:/usr/local/bin:/bin:/sbin 10 | 11 | PROVISIONER_ROOT=/usr/local/opt/${Username} 12 | mkdir -p ${PROVISIONER_ROOT} 13 | chown ${Username} ${PROVISIONER_ROOT} 14 | 15 | tee -a ${PROVISIONER_ROOT}/runprovisioner.sh > /dev/null <<\EOF 16 | #!/bin/bash 17 | 18 | . ${HOME}/.bashrc 19 | 20 | /usr/local/opt/$USER/provisioner/provisioner 21 | EOF 22 | 23 | chmod +x $PROVISIONER_ROOT/runprovisioner.sh 24 | 25 | aria2c \ 26 | --enable-color=false \ 27 | --file-allocation=none \ 28 | -d ${BOOTSTRAP_PATH} "${ProvisionerPackageUri}" >> ${BOOTSTRAP_PATH}/download.log 29 | 30 | aria2c \ 31 | --enable-color=false \ 32 | --file-allocation=none \ 33 | -d ${BOOTSTRAP_PATH} "${ProvisionerScriptUri}" >> ${BOOTSTRAP_PATH}/download.log 34 | 35 | chmod +x ${BOOTSTRAP_PATH}/${ScriptName} 36 | 37 | # Install Provisioner with provided scripts 38 | eval "$BOOTSTRAP_PATH/$ScriptName $BOOTSTRAP_PATH/$ScriptParam $Username" 2>&1 | tee "$BOOTSTRAP_PATH/install.log" 39 | # State File 40 | touch $BOOTSTRAP_PATH/provisionerDone -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/configure-hostname.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | # Add script for changing hostname to run on startup to prevent duplicate hostnames across the environment. Hostname and Computername should contain .local in name to avoid name resolution issues 4 | tee -a /usr/local/bin/change_hostname.sh > /dev/null <<\EOF 5 | #!/bin/bash -e -o pipefail 6 | 7 | name="Mac-$(python3 -c 'from time import time; print(int(round(time() * 1000)))')" 8 | scutil --set HostName "${name}.local" 9 | scutil --set LocalHostName $name 10 | scutil --set ComputerName "${name}.local" 11 | EOF 12 | 13 | chmod +x "/usr/local/bin/change_hostname.sh" 14 | 15 | sudo tee -a /Library/LaunchDaemons/change_hostname.plist > /dev/null <<\EOF 16 | 17 | 18 | 19 | 20 | Label 21 | change-hostname 22 | Program 23 | /usr/local/bin/change_hostname.sh 24 | RunAtLoad 25 | 26 | 27 | 28 | EOF -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/configure-ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | [[ ! -d ~/.ssh ]] && mkdir ~/.ssh 2>/dev/null 4 | chmod 777 ~/.ssh 5 | 6 | ssh-keyscan -t rsa,ecdsa,ed25519 github.com >> ~/.ssh/known_hosts 7 | ssh-keyscan -t rsa ssh.dev.azure.com >> ~/.ssh/known_hosts 8 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/disable-auto-updates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | # Disabling automatic updates 4 | sudo softwareupdate --schedule off 5 | defaults write com.apple.SoftwareUpdate AutomaticDownload -int 0 6 | defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 0 7 | defaults write com.apple.commerce AutoUpdate -bool false 8 | defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool false -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/environment/bashprofile: -------------------------------------------------------------------------------- 1 | [ -f $HOME/.bashrc ] && source $HOME/.bashrc -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/environment/bashrc: -------------------------------------------------------------------------------- 1 | export LC_CTYPE=en_US.UTF-8 2 | export LC_ALL=en_US.UTF-8 3 | export LANG=en_US.UTF-8 4 | 5 | export ANDROID_HOME=${HOME}/Library/Android/sdk 6 | export ANDROID_SDK_ROOT=${HOME}/Library/Android/sdk 7 | 8 | export VM_ASSETS=/usr/local/opt/$USER/scripts 9 | 10 | export NUNIT_BASE_PATH=/Library/Developer/nunit 11 | export NUNIT3_PATH=/Library/Developer/nunit/3.6.0 12 | 13 | export AGENT_TOOLSDIRECTORY=$HOME/hostedtoolcache 14 | export RUNNER_TOOL_CACHE=$HOME/hostedtoolcache 15 | 16 | export PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH 17 | export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH 18 | export PATH=/usr/local/bin:/usr/local/sbin:~/bin:~/.yarn/bin:$PATH 19 | export PATH="/usr/local/opt/curl/bin:$PATH" 20 | export PATH=$HOME/.cargo/bin:$PATH 21 | 22 | export RCT_NO_LAUNCH_PACKAGER=1 23 | export DOTNET_ROOT=$HOME/.dotnet 24 | export DOTNET_MULTILEVEL_LOOKUP=0 25 | 26 | export HOMEBREW_NO_AUTO_UPDATE=1 27 | export HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=3650 28 | export HOMEBREW_CASK_OPTS="--no-quarantine" 29 | 30 | export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 31 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/max-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | Launch_Daemons="/Library/LaunchDaemons" 4 | 5 | # EOF in quotes to disable variable expansion 6 | echo "Creating limit.maxfiles.plist" 7 | cat > "${Launch_Daemons}/limit.maxfiles.plist" << EOF 8 | 9 | 11 | 12 | 13 | Label 14 | limit.maxfiles 15 | ProgramArguments 16 | 17 | launchctl 18 | limit 19 | maxfiles 20 | 65536 21 | 524288 22 | 23 | RunAtLoad 24 | 25 | ServiceIPC 26 | 27 | 28 | 29 | EOF 30 | 31 | echo "limit.maxfiles.plist permissions changing" 32 | chown root:wheel "${Launch_Daemons}/limit.maxfiles.plist" 33 | chmod 0644 "${Launch_Daemons}/limit.maxfiles.plist" 34 | 35 | 36 | echo "Done, limit.maxfiles has been updated" 37 | 38 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/ntpconf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | echo Additional NTP servers adding into /etc/ntp.conf file... 4 | cat > /etc/ntp.conf << EOF 5 | server 0.pool.ntp.org 6 | server 1.pool.ntp.org 7 | server 2.pool.ntp.org 8 | server 3.pool.ntp.org 9 | server time.apple.com 10 | server time.windows.com 11 | EOF 12 | 13 | # Set the timezone to UTC. 14 | echo The Timezone setting to UTC... 15 | ln -sf /usr/share/zoneinfo/UTC /etc/localtime 16 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/configuration/shell-change.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | echo "Changing shell to bash" 4 | sudo chsh -s /bin/bash $USERNAME 5 | sudo chsh -s /bin/bash root -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/apache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | brew install httpd 4 | sudo sed -Ei '' 's/Listen .*/Listen 80/' $(brew --prefix)/etc/httpd/httpd.conf 5 | 6 | invoke_tests "WebServers" "Apache" 7 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/audiodevice.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo "install switchaudio-osx" 5 | brew_smart_install "switchaudio-osx" 6 | 7 | echo "install sox" 8 | brew_smart_install "sox" 9 | 10 | # Big Sur doesn't support soundflower installation without user interaction https://github.com/mattingalls/Soundflower/releases/tag/2.0b2 11 | # Install blackhole-2ch for Big Sur instead 12 | if is_Catalina; then 13 | echo "install soundflower" 14 | brew install --cask soundflower 15 | 16 | echo "set Soundflower (2ch) as input/output device" 17 | SwitchAudioSource -s "Soundflower (2ch)" -t input 18 | SwitchAudioSource -s "Soundflower (2ch)" -t output 19 | else 20 | echo "install blackhole-2ch" 21 | brew_smart_install "blackhole-2ch" 22 | 23 | echo "set BlackHole 2ch as input/output device" 24 | SwitchAudioSource -s "BlackHole 2ch" -t input 25 | SwitchAudioSource -s "BlackHole 2ch" -t output 26 | fi 27 | 28 | invoke_tests "System" "Audio Device" 29 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/aws.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo Installing aws... 5 | AWS_CLI_URL="https://awscli.amazonaws.com/AWSCLIV2.pkg" 6 | download_with_retries $AWS_CLI_URL "/tmp" 7 | sudo installer -pkg /tmp/AWSCLIV2.pkg -target / 8 | 9 | echo Installing aws sam cli... 10 | brew tap aws/tap 11 | brew install aws-sam-cli 12 | 13 | echo "Install aws cli session manager" 14 | brew install --cask session-manager-plugin 15 | 16 | invoke_tests "Common" "AWS" 17 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/azcopy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | AZCOPY_DOWNLOAD_URL="https://aka.ms/downloadazcopy-v10-mac" 5 | 6 | download_with_retries $AZCOPY_DOWNLOAD_URL "/tmp" "azcopy.zip" 7 | unzip /tmp/azcopy.zip -d azcopy 8 | AZCOPY_EXTRACTED=$(echo azcopy/azcopy*) 9 | cp "$AZCOPY_EXTRACTED/azcopy" "/usr/local/bin/azcopy" 10 | chmod +x "/usr/local/bin/azcopy" 11 | 12 | echo "Done, cleaning up" 13 | rm -rf azcopy* 14 | 15 | invoke_tests "Common" "AzCopy" 16 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/bicep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | echo Installing bicep cli... 4 | brew tap azure/bicep 5 | brew install bicep 6 | 7 | invoke_tests "Common" "Bicep" 8 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/build-xcode-symlinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | source ~/utils/utils.sh 4 | 5 | # Link the existing Xcodes into the correct location for provisionator. 6 | 7 | # These symlinks are necessary for Xamarin team to make sure that xamarin-provisionator can find them. 8 | 9 | # Old style provisionator directories. This is maintained for 10 | # backwards compatibility only. Do not add new xcodes here. 11 | ln -sf /Applications/Xcode_8.app /Applications/Xcode8.app 12 | ln -sf /Applications/Xcode_8.1.app /Applications/Xcode81.app 13 | ln -sf /Applications/Xcode_9.app /Applications/Xcode9.app 14 | ln -sf /Applications/Xcode_9.1.app /Applications/Xcode91.app 15 | ln -sf /Applications/Xcode_9.2.app /Applications/Xcode92.app 16 | ln -sf /Applications/Xcode_9.3.app /Applications/Xcode93.app 17 | ln -sf /Applications/Xcode_9.3.app /Applications/Xcode_9.3_beta.app 18 | ln -sf /Applications/Xcode_9.4.app /Applications/Xcode_9.4-beta.app 19 | ln -sf /Applications/Xcode_9.4.app /Applications/Xcode_9.4_beta.app 20 | ln -sf /Applications/Xcode_9.4.app /Applications/Xcode_9.4_beta_2.app -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/chrome.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo "Installing Chrome..." 5 | brew_cask_install_ignoring_sha256 "google-chrome" 6 | 7 | echo "Installing Chrome Driver" 8 | brew install --cask chromedriver 9 | 10 | echo "Installing Selenium" 11 | brew_smart_install "selenium-server" 12 | 13 | CHROMEWEBDRIVER_DIR=$(readlink $(which chromedriver) | xargs dirname) 14 | echo "export CHROMEWEBDRIVER=$CHROMEWEBDRIVER_DIR" >> "${HOME}/.bashrc" 15 | 16 | invoke_tests "Browsers" "Chrome" 17 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/cocoapods.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | # Setup the Cocoapods 4 | echo "Installing Cocoapods..." 5 | pod setup 6 | 7 | # Create a symlink to /usr/local/bin since it was removed due to Homebrew change. 8 | ln -sf $(which pod) /usr/local/bin/pod 9 | 10 | invoke_tests "Common" "CocoaPods" 11 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/firefox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo "Installing Firefox..." 5 | brew install --cask firefox 6 | 7 | echo "Installing Geckodriver..." 8 | brew_smart_install "geckodriver" 9 | geckoPath="$(brew --prefix geckodriver)/bin" 10 | 11 | echo "Add GECKOWEBDRIVER to bashrc..." 12 | echo "export GECKOWEBDRIVER=${geckoPath}" >> "${HOME}/.bashrc" 13 | 14 | invoke_tests "Browsers" "Firefox" 15 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | gccVersions=$(get_toolset_value '.gcc.versions | .[]') 5 | 6 | for gccVersion in $gccVersions; do 7 | brew_smart_install "gcc@${gccVersion}" 8 | done 9 | 10 | # Delete default gfortran link if it exists https://github.com/actions/virtual-environments/issues/1280 11 | gfortranPath=$(which gfortran) 12 | if [ $gfortranPath ]; then 13 | rm $gfortranPath 14 | fi 15 | 16 | invoke_tests "Common" "GCC" 17 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo Installing Git... 5 | brew_smart_install "git" 6 | 7 | git config --global --add safe.directory "*" 8 | 9 | echo Installing Git LFS 10 | brew_smart_install "git-lfs" 11 | 12 | # Update global git config 13 | git lfs install 14 | # Update system git config 15 | sudo git lfs install --system 16 | 17 | echo Installing Hub 18 | brew_smart_install "hub" 19 | 20 | echo Disable all the Git help messages... 21 | git config --global advice.pushUpdateRejected false 22 | git config --global advice.pushNonFFCurrent false 23 | git config --global advice.pushNonFFMatching false 24 | git config --global advice.pushAlreadyExists false 25 | git config --global advice.pushFetchFirst false 26 | git config --global advice.pushNeedsForce false 27 | git config --global advice.statusHints false 28 | git config --global advice.statusUoption false 29 | git config --global advice.commitBeforeMerge false 30 | git config --global advice.resolveConflict false 31 | git config --global advice.implicitIdentity false 32 | git config --global advice.detachedHead false 33 | git config --global advice.amWorkDir false 34 | git config --global advice.rmHints false 35 | 36 | invoke_tests "Git" 37 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/golang.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | DEFAULT_GO_VERSION=$(get_toolset_value '.go.default') 5 | echo "Installing Go..." 6 | brew_smart_install "go@${DEFAULT_GO_VERSION}" 7 | 8 | # Create symlinks to preserve backward compatibility. Symlinks are not created when non-latest go is being installed 9 | ln -sf $(brew --prefix go@${DEFAULT_GO_VERSION})/bin/* /usr/local/bin/ 10 | 11 | invoke_tests "Common" "Go" -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/graalvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo Installing GraalVM... 5 | brew install --cask graalvm/tap/graalvm-ce-java11 6 | 7 | exportPath=$(echo /Library/Java/JavaVirtualMachines/graalvm-ce-java*/Contents/Home/bin) 8 | echo "Setting up GRAALVM_11_ROOT variable to ${exportPath}" 9 | echo "export GRAALVM_11_ROOT=${exportPath}" >> "${HOME}/.bashrc" 10 | 11 | # GraalVM not being signed and notarized yet on macOS Catalina 12 | if is_Catalina; then 13 | quarantinePath=$(echo /Library/Java/JavaVirtualMachines/graalvm-ce-java*) 14 | sudo xattr -rd com.apple.quarantine $quarantinePath 15 | fi 16 | 17 | # Install Native Image 18 | $exportPath/gu install native-image 19 | 20 | invoke_tests "Common" "GraalVM" -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/haskell.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh 4 | export PATH="$HOME/.ghcup/bin:$PATH" 5 | echo 'export PATH="$PATH:$HOME/.ghcup/bin"' >> "$HOME/.bashrc" 6 | 7 | # ghcup output looks like this "ghc 8.6.4 base-4.12.0.0 hls-powered", need to take all the first versions only(8.6.4 in that case) and avoid pre-release ones 8 | availableVersions=$(ghcup list -t ghc -r | grep -v "prerelease" | awk '{print $2}') 9 | 10 | # Install 3 latest major versions(For instance 8.6.5, 8.8.4, 8.10.2) 11 | minorMajorVersions=$(echo "$availableVersions" | cut -d"." -f 1,2 | uniq | tail -n3) 12 | for majorMinorVersion in $minorMajorVersions; do 13 | fullVersion=$(echo "$availableVersions" | grep "$majorMinorVersion." | tail -n1) 14 | echo "install ghc version $fullVersion..." 15 | ghcup install $fullVersion 16 | ghcup set $fullVersion 17 | 18 | # remove docs and profiling libs 19 | ghc_dir="$(ghcup whereis basedir)/ghc/$fullVersion" 20 | [ -e "${ghc_dir}" ] || exit 1 21 | find "${ghc_dir}" \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete 22 | rm -r "${ghc_dir}"/share/* 23 | unset ghc_bin_dir ghc_dir 24 | done 25 | 26 | echo "install cabal..." 27 | ghcup install-cabal 28 | 29 | invoke_tests "Haskell" 30 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/homebrew.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | source ~/utils/utils.sh 4 | 5 | echo "Installing Homebrew..." 6 | HOMEBREW_INSTALL_URL="https://raw.githubusercontent.com/Homebrew/install/master/install.sh" 7 | /bin/bash -c "$(curl -fsSL ${HOMEBREW_INSTALL_URL})" 8 | 9 | echo "Disabling Homebrew analytics..." 10 | brew analytics off 11 | 12 | # jq is required for further installation scripts 13 | echo "Installing jq..." 14 | brew install jq 15 | 16 | echo "Installing curl..." 17 | brew install curl 18 | 19 | echo "Installing wget..." 20 | brew_smart_install "wget" 21 | 22 | # init brew bundle feature 23 | brew tap Homebrew/bundle -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/llvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | llvmVersion=$(get_toolset_value '.llvm.version') 5 | 6 | brew_smart_install "llvm@${llvmVersion}" 7 | 8 | invoke_tests "LLVM" -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/miniconda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | MINICONDA_INSTALLER="/tmp/miniconda.sh" 4 | curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o $MINICONDA_INSTALLER 5 | chmod +x $MINICONDA_INSTALLER 6 | sudo $MINICONDA_INSTALLER -b -p /usr/local/miniconda 7 | 8 | # Chmod with full permissions recursively to avoid permissions restrictions 9 | sudo chmod -R 777 /usr/local/miniconda 10 | 11 | sudo ln -s /usr/local/miniconda/bin/conda /usr/local/bin/conda 12 | 13 | if [ -d "$HOME/.conda" ]; then 14 | sudo chown -R $USER "$HOME/.conda" 15 | fi 16 | 17 | echo "export CONDA=/usr/local/miniconda" >> $HOME/.bashrc 18 | 19 | invoke_tests "Common" "Miniconda" 20 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/mongodb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | # MongoDB object-value database 5 | # Install latest release version of MongoDB Community Edition 6 | # https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x 7 | toolsetVersion=$(get_toolset_value '.mongodb.version') 8 | 9 | brew tap mongodb/brew 10 | versionToInstall=$(brew search --formulae /mongodb-community@$toolsetVersion/ | awk -F'/' '{print $3}' | tail -1) 11 | echo "Installing mongodb $versionToInstall" 12 | brew_smart_install "$versionToInstall" 13 | 14 | if ! which mongo ; then 15 | brew link "$versionToInstall" 16 | fi 17 | 18 | invoke_tests "Databases" "MongoDB" 19 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | brew install nginx 4 | sudo sed -Ei '' 's/listen.*/listen 80;/' $(brew --prefix)/etc/nginx/nginx.conf 5 | 6 | invoke_tests "WebServers" "Nginx" 7 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | defaultVersion=$(get_toolset_value '.node.default') 5 | 6 | echo "Installing Node.js $defaultVersion" 7 | brew_smart_install "node@$defaultVersion" 8 | brew link node@$defaultVersion --force 9 | 10 | echo Installing yarn... 11 | curl -o- -L https://yarnpkg.com/install.sh | bash 12 | 13 | npm_global_packages=$(get_toolset_value '.npm.global_packages[].name') 14 | for module in ${npm_global_packages[@]}; do 15 | echo "Install $module" 16 | npm install -g $module 17 | done 18 | 19 | invoke_tests "Node" "Node.js" 20 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/nvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | ########################################################################### 3 | # The script installs node version manager with node versions 10,12 and 14 4 | # 5 | ########################################################################### 6 | source ~/utils/utils.sh 7 | 8 | [ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") 9 | VERSION=$(curl "${authString[@]}" -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name') 10 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash 11 | 12 | if [ $? -eq 0 ]; then 13 | . ~/.bashrc 14 | nvm --version 15 | nodeVersions=$(get_toolset_value '.node.nvm_versions[]') 16 | for version in ${nodeVersions[@]} 17 | do 18 | nvm install v${version} 19 | done 20 | 21 | # set system node as default 22 | nvm alias default system 23 | else 24 | echo error 25 | fi 26 | 27 | echo "Node version manager has been installed successfully" 28 | 29 | invoke_tests "Node" "nvm" 30 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/open_windows_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | retry=10 4 | while [ $retry -gt 0 ]; do 5 | openwindows=$(osascript -e 'tell application "System Events" to get every window of (every process whose class of windows contains window)') && break 6 | 7 | retry=$((retry-1)) 8 | if [ $retry -eq 0 ]; then 9 | echo "No retry attempts left" 10 | exit 1 11 | fi 12 | sleep 30 13 | done 14 | IFS=',' read -r -a windowslist <<< "$openwindows" 15 | 16 | if [ -n "${openwindows}" ]; then 17 | echo "Found opened window:" 18 | fi 19 | 20 | for window in "${windowslist[@]}"; do 21 | if [[ $window =~ "NotificationCenter" ]]; then 22 | echo "[Warning] $window" 23 | else 24 | echo " - ${window}" | xargs 25 | scripterror=true 26 | fi 27 | done 28 | 29 | if [ "${scripterror}" = true ]; then 30 | exit 1 31 | fi 32 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/openssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo "Install openssl@1.1" 5 | brew_smart_install "openssl@1.1" 6 | 7 | # Symlink brew openssl@1.1 to `/usr/local/bin` as Homebrew refuses 8 | ln -sf $(brew --prefix openssl@1.1)/bin/openssl /usr/local/bin/openssl 9 | 10 | # Most of buildsystems and scripts look up ssl here 11 | ln -sf $(brew --cellar openssl@1.1)/1.1* /usr/local/opt/openssl 12 | 13 | invoke_tests "OpenSSL" 14 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/php.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo Installing PHP 5 | phpVersionToolset=$(get_toolset_value '.php.version') 6 | brew_smart_install "php@${phpVersionToolset}" 7 | 8 | echo Installing composer 9 | brew_smart_install "composer" 10 | 11 | invoke_tests "PHP" 12 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/pipx-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | export PATH="$PATH:/opt/pipx_bin" 5 | 6 | toolset=$(get_toolset_path) 7 | pipx_packages=$(jq -r ".pipx[] .package" $toolset) 8 | 9 | for package in $pipx_packages; do 10 | python_version=$(jq -r ".pipx[] | select(.package == \"$package\") .python" $toolset) 11 | if [ "$python_version" != "null" ]; then 12 | python_path="$HOME/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version" 13 | echo "Install $package into python $python_path" 14 | pipx install $package --python $python_path 15 | else 16 | echo "Install $package into default python" 17 | pipx install $package 18 | fi 19 | done 20 | 21 | invoke_tests "PipxPackages" 22 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/postgresql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | # Fetch PostgreSQL version to install from the toolset 5 | toolsetVersion=$(get_toolset_value '.postgresql.version') 6 | 7 | # Install latest version of PostgreSQL 8 | brew_smart_install postgresql@$toolsetVersion 9 | 10 | # Service PostgreSQL should be started before use 11 | brew services start postgresql 12 | 13 | # Verify PostgreSQL is ready for accept incoming connections 14 | echo "Check PostgreSQL service is running" 15 | i=10 16 | COMMAND='pg_isready' 17 | while [ $i -gt 0 ]; do 18 | echo "Check PostgreSQL service status" 19 | eval $COMMAND && break 20 | ((i--)) 21 | if [ $i == 0 ]; then 22 | echo "PostgreSQL service not ready, all attempts exhausted" 23 | exit 1 24 | fi 25 | echo "PostgreSQL service not ready, wait 10 more sec, attempts left: $i" 26 | sleep 10 27 | done 28 | 29 | # Stop PostgreSQL 30 | brew services stop postgresql 31 | 32 | invoke_tests "Databases" "PostgreSQL" 33 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo "Installing Python Tooling" 5 | 6 | echo "Install latest Python 2" 7 | Python2Url="https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg" 8 | download_with_retries $Python2Url "/tmp" "python2.pkg" 9 | sudo installer -pkg /tmp/python2.pkg -target / 10 | pip install --upgrade pip 11 | 12 | echo "Install Python2 certificates" 13 | bash -c "/Applications/Python\ 2.7/Install\ Certificates.command" 14 | 15 | # Close Finder window 16 | if is_Veertu; then 17 | close_finder_window 18 | fi 19 | 20 | # Explicitly overwrite symlinks created by Python2 such as /usr/local/bin/2to3 since they conflict with symlinks from Python3 21 | # https://github.com/actions/virtual-environments/issues/2322 22 | echo "Brew Installing Python 3" 23 | brew_smart_install "python@3.9" || brew link --overwrite python@3.9 24 | 25 | echo "Installing pipx" 26 | export PIPX_BIN_DIR=/usr/local/opt/pipx_bin 27 | export PIPX_HOME=/usr/local/opt/pipx 28 | 29 | brew_smart_install "pipx" 30 | 31 | echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc" 32 | echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc" 33 | echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc" 34 | 35 | invoke_tests "Python" 36 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/reboot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | shutdown -r now -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/rubygem.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo Updating RubyGems... 5 | gem update --system 6 | 7 | gemsToInstall=$(get_toolset_value '.ruby.rubygems | .[]') 8 | if [ -n "$gemsToInstall" ]; then 9 | for gem in $gemsToInstall; do 10 | echo "Installing gem $gem" 11 | gem install $gem 12 | done 13 | fi 14 | 15 | invoke_tests "RubyGem" 16 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/rust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo Installing Rustup... 5 | brew_smart_install "rustup-init" 6 | 7 | echo Installing Rust language... 8 | rustup-init -y --no-modify-path --default-toolchain=stable --profile=minimal 9 | 10 | echo Initialize environment variables... 11 | CARGO_HOME=$HOME/.cargo 12 | 13 | echo Install common tools... 14 | rustup component add rustfmt clippy 15 | cargo install --locked bindgen cbindgen cargo-audit cargo-outdated 16 | 17 | echo Cleanup Cargo registry cached data... 18 | rm -rf $CARGO_HOME/registry/* 19 | 20 | invoke_tests "Rust" 21 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/safari.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | echo "Enabling safari driver..." 4 | # https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari 5 | # Safari’s executable is located at /usr/bin/safaridriver 6 | # Configure Safari to Enable WebDriver Support 7 | sudo safaridriver --enable 8 | 9 | echo "Enabling the 'Allow Remote Automation' option in Safari's Develop menu" 10 | mkdir -p $HOME/Library/WebDriver 11 | safari_plist="$HOME/Library/WebDriver/com.apple.Safari.plist" 12 | # "|| true" is needed to suppress exit code 1 in case if property or file doesn't exist 13 | /usr/libexec/PlistBuddy -c 'delete AllowRemoteAutomation' $safari_plist || true 14 | /usr/libexec/PlistBuddy -c 'add AllowRemoteAutomation bool true' $safari_plist 15 | 16 | invoke_tests "Browsers" "Safari" -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/stack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo "Get the latest Stack version..." 5 | stackDownloadUrl=$(get_github_package_download_url "commercialhaskell/stack" "contains(\"osx-x86_64.tar.gz\")" "latest" "$API_PAT") 6 | stackVersion=$(echo $stackDownloadUrl | cut -d "/" -f8 | tr -d "v") 7 | stackArchive="/tmp/stack.tar.gz" 8 | 9 | echo "Download stack version $stackVersion..." 10 | download_with_retries $stackDownloadUrl "/tmp" "stack.tar.gz" 11 | 12 | stackToolcachePath="$AGENT_TOOLSDIRECTORY/stack/$stackVersion" 13 | destinationPath="$stackToolcachePath/x64" 14 | 15 | mkdir -p $destinationPath 16 | 17 | echo "Unzip stack archive..." 18 | tar -xzf $stackArchive -C $destinationPath --strip 1 19 | 20 | touch $stackToolcachePath/x64.complete 21 | 22 | echo "export PATH="\$PATH":$destinationPath" >> "$HOME/.bashrc" 23 | 24 | invoke_tests "Common" "Stack" 25 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/swiftlint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | echo "Install SwiftLint" 5 | swiftlintUrl=$(get_github_package_download_url "realm/SwiftLint" "contains(\"portable_swiftlint.zip\")" "latest" "$API_PAT") 6 | download_with_retries $swiftlintUrl "/tmp" "portable_swiftlint.zip" 7 | unzip -q "/tmp/portable_swiftlint.zip" -d /usr/local/bin 8 | # Remove the LICENSE file that comes along with the binary and the downloaded archive 9 | rm -rf "/usr/local/bin/LICENSE" 10 | rm -rf "/tmp/portable_swiftlint.zip" 11 | 12 | invoke_tests "Linters" "SwiftLint" 13 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/vcpkg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | source ~/utils/utils.sh 3 | 4 | # Set env variable for vcpkg 5 | VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg 6 | echo "export VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a ~/.bashrc 7 | 8 | # Install vcpkg 9 | git clone https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT 10 | $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh 11 | $VCPKG_INSTALLATION_ROOT/vcpkg integrate install 12 | chmod -R 0777 $VCPKG_INSTALLATION_ROOT 13 | ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin 14 | 15 | invoke_tests "Common" "vcpkg" 16 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/xcode-postbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | source ~/utils/utils.sh 4 | XCODE_LIST=($(get_toolset_value '.xcode.versions | reverse | .[].link')) 5 | DEFAULT_XCODE_VERSION=$(get_toolset_value '.xcode.default') 6 | 7 | # https://github.com/microsoft/appcenter/issues/847 8 | # Assets.xcassets : error : CoreData: error: (6922) I/O error for database 9 | # at $HOME/Library/Developer/Xcode/UserData/IB Support/Simulator Devices/{GUID} 10 | echo "Erase a device's contents and settings:" 11 | for XCODE_VERSION in "${XCODE_LIST[@]}" 12 | do 13 | echo " Xcode Version: ${XCODE_VERSION}" 14 | launchctl remove com.apple.CoreSimulator.CoreSimulatorService || true 15 | #add sleep to let CoreSimulatorService to exit 16 | sleep 3 17 | 18 | # Select xcode version by default 19 | sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer" 20 | 21 | # Erase a device's contents and settings 22 | xcrun simctl erase all 23 | 24 | #add sleep due to sometimes "xcrun simctl list" takes more than a few moments and script fails when trying to remove CoreSimulatorSerivce 25 | sleep 10 26 | done 27 | 28 | # Select xcode version by default 29 | echo "Setting Xcode ${DEFAULT_XCODE_VERSION} as default" 30 | sudo xcode-select -s "/Applications/Xcode_${DEFAULT_XCODE_VERSION}.app/Contents/Developer" 31 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/core/xcode-sims.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | source ~/utils/utils.sh 4 | 5 | # Downloading and installing simulators 6 | SIMS_TO_INSTALL=( 7 | "8.4" 8 | "9.0" 9 | "9.1" 10 | "9.2" 11 | "9.3" 12 | "10.0" 13 | "10.1" 14 | "10.2" 15 | "10.3" 16 | ) 17 | 18 | for SIM_VERSION in ${SIMS_TO_INSTALL[@]} 19 | do 20 | echo "Installing iOS $SIM_VERSION ..." 21 | sudo xcversion simulators --install="iOS ${SIM_VERSION}" 22 | echo "Successfuly installed iOS $SIM_VERSION ..." 23 | done 24 | 25 | echo "Done installing simulator runtimes." 26 | -------------------------------------------------------------------------------- /.github-actions/images/macos/provision/utils/invoke-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e -o pipefail 2 | 3 | source $HOME/.bashrc 4 | pwsh -Command "Import-Module '$HOME/image-generation/helpers/Tests.Helpers.psm1' -DisableNameChecking 5 | Invoke-PesterTests -TestFile \"$1\" -TestName \"$2\"" 6 | -------------------------------------------------------------------------------- /.github-actions/images/macos/software-report/SoftwareReport.Java.psm1: -------------------------------------------------------------------------------- 1 | function Get-JavaVersions { 2 | $defaultJavaPath = (Get-Item env:JAVA_HOME).value 3 | $javaVersions = Get-Item env:JAVA_HOME_*_X64 4 | $sortRules = @{ 5 | Expression = { [Int32]$_.Name.Split("_")[2] } 6 | Descending = $false 7 | } 8 | 9 | return $javaVersions | Sort-Object $sortRules | ForEach-Object { 10 | $javaPath = $_.Value 11 | # Take semver from the java path 12 | $version = $javaPath.split('/')[5] 13 | $fullVersion = $version.Replace('-', '+') 14 | $defaultPostfix = ($javaPath -eq $defaultJavaPath) ? " (default)" : "" 15 | $vendorName = ($javaPath -like '*Java_Adopt_jdk*') ? "Adopt OpenJDK" : "Eclipse Temurin" 16 | 17 | [PSCustomObject] @{ 18 | "Version" = $fullVersion + $defaultPostfix 19 | "Vendor" = $vendorName 20 | "Environment Variable" = $_.Name 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/Databases.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "MongoDB" { 2 | It "" -TestCases @( 3 | @{ ToolName = "mongo" } 4 | @{ ToolName = "mongod" } 5 | ) { 6 | $toolsetVersion = Get-ToolsetValue 'mongodb.version' 7 | (&$ToolName --version)[2].Split('"')[-2] | Should -BeLike "$toolsetVersion*" 8 | } 9 | } 10 | 11 | Describe "PostgreSQL" { 12 | It "PostgreSQL version should correspond to the version in the toolset" { 13 | $toolsetVersion = Get-ToolsetValue 'postgresql.version' 14 | # Client version 15 | (psql --version).split()[-1] | Should -BeLike "$toolsetVersion*" 16 | # Server version 17 | (pg_config --version).split()[-1] | Should -BeLike "$toolsetVersion*" 18 | } 19 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/Git.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Git" { 2 | It "git is installed" { 3 | "git --version" | Should -ReturnZeroExitCode 4 | } 5 | 6 | It "git lfs is installed" { 7 | "git lfs version" | Should -ReturnZeroExitCode 8 | } 9 | 10 | It "hub CLI is installed" { 11 | "hub --version" | Should -ReturnZeroExitCode 12 | } 13 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/Haskell.Tests.ps1: -------------------------------------------------------------------------------- 1 | $os = Get-OSVersion 2 | 3 | Describe "Haskell" { 4 | Context "GHCup" { 5 | It "GHCup" { 6 | "ghcup --version" | Should -ReturnZeroExitCode 7 | } 8 | } 9 | Context "GHC" { 10 | It "GHC" { 11 | "ghc --version" | Should -ReturnZeroExitCode 12 | } 13 | } 14 | Context "Cabal" { 15 | It "Cabal" { 16 | "cabal --version" | Should -ReturnZeroExitCode 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/LLVM.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Clang/LLVM" { 2 | BeforeAll { 3 | $toolsetVersion = Get-ToolsetValue 'llvm.version' 4 | } 5 | 6 | It "Clang/LLVM is installed and version is correct" { 7 | $clangVersion = & "$(brew --prefix llvm@$toolsetVersion)/bin/clang" --version 8 | $clangVersion[0] | Should -BeLike "*${toolsetVersion}*" 9 | } 10 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/Linters.Tests.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking 2 | 3 | $os = Get-OSVersion 4 | 5 | Describe "SwiftLint" { 6 | It "SwiftLint" { 7 | "swiftlint version" | Should -ReturnZeroExitCode 8 | } 9 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/OpenSSL.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "OpenSSL" { 2 | Context "OpenSSL Version" { 3 | It "OpenSSL is available" { 4 | "openssl version" | Should -ReturnZeroExitCode 5 | } 6 | } 7 | 8 | Context "OpenSSL 1.1 Path Check" { 9 | It "OpenSSL 1.1 path exists" { 10 | $openSSLpath = "/usr/local/opt/openssl@1.1" 11 | $openSSLpath | Should -Exist 12 | } 13 | } 14 | 15 | Context "OpenSSL 1.1 is default" { 16 | It "Default OpenSSL version is 1.1" { 17 | $commandResult = Get-CommandResult "openssl version" 18 | $commandResult.Output | Should -Match "OpenSSL 1.1" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/PHP.Tests.ps1: -------------------------------------------------------------------------------- 1 | $os = Get-OSVersion 2 | 3 | Describe "PHP" { 4 | Context "PHP" { 5 | It "PHP Path" { 6 | Get-WhichTool "php" | Should -Not -BeLike "/usr/bin/php*" 7 | } 8 | It "PHP version" { 9 | $phpVersionToolset = Get-ToolsetValue 'php.version' 10 | $phpInstalledVersion = php --version | Out-String | Select-String "${phpVersionToolset}" 11 | $phpInstalledVersion | Should -BeLike "PHP ${phpVersionToolset}*" 12 | } 13 | } 14 | 15 | Context "Composer" { 16 | It "Composer" { 17 | "composer --version" | Should -ReturnZeroExitCode 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/PipxPackages.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "PipxPackages" { 2 | $pipxToolset = Get-ToolsetValue "pipx" 3 | $testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} } 4 | It "" -TestCases $testCases { 5 | "$cmd" | Should -ReturnZeroExitCode 6 | } 7 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/Ruby.Tests.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" 2 | Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking 3 | 4 | Describe "Ruby" { 5 | It "Ruby is available" { 6 | "ruby --version" | Should -ReturnZeroExitCode 7 | } 8 | 9 | It "Ruby is installed via HomeBrew" { 10 | Get-WhichTool "ruby" | Should -Not -BeLike "/usr/bin/ruby*" 11 | } 12 | 13 | It "Ruby tools are consistent" { 14 | $expectedPrefix = "/usr/local" 15 | Get-WhichTool "ruby" | Should -Match "$($expectedPrefix)*" 16 | Get-WhichTool "gem" | Should -Match "$($expectedPrefix)*" 17 | Get-WhichTool "bundler" | Should -Match "$($expectedPrefix)*" 18 | } 19 | 20 | It "Ruby gems permissions are valid" { 21 | "gem install bundle" | Should -ReturnZeroExitCode 22 | "gem uninstall bundle" | Should -ReturnZeroExitCode 23 | } 24 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/RubyGem.Tests.ps1: -------------------------------------------------------------------------------- 1 | $os = Get-OSVersion 2 | 3 | Describe "RubyGems" { 4 | $gemTestCases = Get-ToolsetValue -KeyPath "ruby.rubygems" | ForEach-Object { 5 | @{gemName = $_} 6 | } 7 | 8 | if ($gemTestCases) 9 | { 10 | It "Gem is installed" -TestCases $gemTestCases { 11 | "gem list -i '^$gemName$'" | Should -MatchCommandOutput "true" 12 | } 13 | } 14 | } 15 | 16 | Describe "Bundler" { 17 | It "Bundler" { 18 | "bundler --version" | Should -ReturnZeroExitCode 19 | } 20 | } 21 | 22 | Describe "Nomad shenzhen CLI" -Skip:($os.IsMonterey) { 23 | It "Nomad shenzhen CLI" { 24 | "ipa --version" | Should -ReturnZeroExitCode 25 | } 26 | } 27 | 28 | Describe "Fastlane" { 29 | It "Fastlane" { 30 | "fastlane --version" | Should -ReturnZeroExitCode 31 | } 32 | } 33 | 34 | Describe "xcpretty" { 35 | It "xcpretty" { 36 | "xcpretty --version" | Should -ReturnZeroExitCode 37 | } 38 | } 39 | 40 | Describe "jazzy" { 41 | It "jazzy" { 42 | "jazzy --version" | Should -ReturnZeroExitCode 43 | } 44 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/RunAll-Tests.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking 2 | 3 | Invoke-PesterTests "*" -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/Rust.Tests.ps1: -------------------------------------------------------------------------------- 1 | $os = Get-OSVersion 2 | 3 | Describe "Rust" { 4 | Context "Rust" { 5 | It "Rustup is installed" { 6 | "rustup --version" | Should -ReturnZeroExitCode 7 | } 8 | 9 | It "Rustc is installed" { 10 | "rustc --version" | Should -ReturnZeroExitCode 11 | } 12 | } 13 | 14 | Context "Cargo" { 15 | It "Cargo is installed" { 16 | "cargo --version" | Should -ReturnZeroExitCode 17 | } 18 | } 19 | 20 | Context "Cargo dependencies" { 21 | It "bindgen" { 22 | "bindgen --version" | Should -ReturnZeroExitCode 23 | } 24 | 25 | It "cbindgen" { 26 | "cbindgen --version" | Should -ReturnZeroExitCode 27 | } 28 | 29 | It "Cargo audit" { 30 | "cargo audit --version" | Should -ReturnZeroExitCode 31 | } 32 | 33 | It "Cargo outdated" { 34 | "cargo outdated --version" | Should -ReturnZeroExitCode 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /.github-actions/images/macos/tests/WebServers.Tests.ps1: -------------------------------------------------------------------------------- 1 | $os = Get-OSVersion 2 | 3 | Describe "Apache" { 4 | It "Apache CLI" { 5 | "httpd -v" | Should -ReturnZeroExitCode 6 | } 7 | 8 | It "Apache Service" { 9 | brew services list | Out-String | Should -Match "httpd\s+(stopped|none)" 10 | } 11 | } 12 | 13 | Describe "Nginx" { 14 | It "Nginx CLI" { 15 | "nginx -v" | Should -ReturnZeroExitCode 16 | } 17 | 18 | It "Nginx Service" { 19 | brew services list | Out-String | Should -Match "nginx\s+(stopped|none)" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github-actions/images/win/post-generation/InternetExplorerConfiguration.ps1: -------------------------------------------------------------------------------- 1 | # https://docs.microsoft.com/en-us/troubleshoot/browsers/enhanced-security-configuration-faq#how-to-disable-internet-explorer-esc-by-using-a-script 2 | # turn off the Internet Explorer Enhanced Security feature 3 | Rundll32 iesetup.dll, IEHardenLMSettings, 1, True 4 | Rundll32 iesetup.dll, IEHardenUser, 1, True 5 | Rundll32 iesetup.dll, IEHardenAdmin, 1, True 6 | $AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" 7 | $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" 8 | Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force 9 | Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force 10 | # restart Explorer process 11 | $ieProcess = Get-Process -Name Explorer -ErrorAction Ignore 12 | if ($ieProcess) { 13 | Stop-Process -Name Explorer -Force -ErrorAction Ignore 14 | } 15 | Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." 16 | -------------------------------------------------------------------------------- /.github-actions/images/win/post-generation/Msys2FirstLaunch.ps1: -------------------------------------------------------------------------------- 1 | # create user profile at the first launch 2 | $null = cmd /c "C:\msys64\usr\bin\bash.exe -leo pipefail -c 'echo $SHELL' 2>&1" -------------------------------------------------------------------------------- /.github-actions/images/win/post-generation/VSConfiguration.ps1: -------------------------------------------------------------------------------- 1 | $vsInstallRoot = (Get-VisualStudioInstance).InstallationPath 2 | $devEnvPath = "$vsInstallRoot\Common7\IDE\devenv.exe" 3 | 4 | # Initialize Visual Studio Experimental Instance 5 | # The Out-Null cmdlet is required to ensure PowerShell waits until the '/ResetSettings' command fully completes. 6 | & "$devEnvPath" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Out-Null 7 | 8 | cmd.exe /c "`"$devEnvPath`" /updateconfiguration" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/ImageHelpers/test/ImageHelpers.Tests.ps1: -------------------------------------------------------------------------------- 1 | $ModuleManifestName = 'ImageHelpers.psd1' 2 | $ModuleManifestPath = "$PSScriptRoot\..\$ModuleManifestName" 3 | 4 | 5 | 6 | Describe 'Module Manifest Tests' { 7 | It 'Passes Test-ModuleManifest' { 8 | Test-ModuleManifest -Path $ModuleManifestPath | Should Not BeNullOrEmpty 9 | $? | Should Be $true 10 | } 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/ImageHelpers/test/PathHelpers.Tests.ps1: -------------------------------------------------------------------------------- 1 | . $PSScriptRoot\..\PathHelpers.ps1 2 | 3 | Describe 'Test-MachinePath Tests' { 4 | Mock Get-MachinePath {return "C:\foo;C:\bar"} 5 | It 'Path contains item' { 6 | Test-MachinePath -PathItem "C:\foo" | Should Be $true 7 | } 8 | It 'Path does not containe item' { 9 | Test-MachinePath -PathItem "C:\baz" | Should Be $false 10 | } 11 | } 12 | 13 | Describe 'Set-MachinePath Tests' { 14 | Mock Get-MachinePath {return "C:\foo;C:\bar"} 15 | Mock Set-ItemProperty {return} 16 | It 'Set-MachinePath should return new path' { 17 | Set-MachinePath -NewPath "C:\baz" | Should Be "C:\baz" 18 | } 19 | } 20 | 21 | Describe "Add-MachinePathItem Tests"{ 22 | Mock Get-MachinePath {return "C:\foo;C:\bar"} 23 | Mock Set-ItemProperty {return} 24 | It 'Add-MachinePathItem should return complete path' { 25 | Add-MachinePathItem -PathItem 'C:\baz' | Should Be 'C:\baz;C:\foo;C:\bar' 26 | } 27 | } 28 | 29 | Describe 'Set-SystemVariable Tests' { 30 | Mock Set-ItemProperty {return} 31 | It 'Set-SystemVariable should return new path' { 32 | Set-SystemVariable -SystemVariable "NewPathVar" -Value "C:\baz" | Should Be "C:\baz" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Configure-DynamicPort.ps1: -------------------------------------------------------------------------------- 1 | # https://support.microsoft.com/en-us/help/929851/the-default-dynamic-port-range-for-tcp-ip-has-changed-in-windows-vista 2 | # The new default start port is 49152, and the new default end port is 65535. 3 | # Default port configuration was changed during image generation by Visual Studio Enterprise Installer to: 4 | # Protocol tcp Dynamic Port Range 5 | # --------------------------------- 6 | # Start Port : 1024 7 | # Number of Ports : 64511 8 | Write-Host "Set the dynamic port range to start at port 49152 and to end at the 65536 (16384 ports)" 9 | $null = netsh int ipv4 set dynamicport tcp start=49152 num=16384 10 | $null = netsh int ipv4 set dynamicport udp start=49152 num=16384 11 | $null = netsh int ipv6 set dynamicport tcp start=49152 num=16384 12 | $null = netsh int ipv6 set dynamicport udp start=49152 num=16384 13 | 14 | Invoke-PesterTests -TestFile "WindowsFeatures" -TestName "DynamicPorts" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Configure-GDIProcessHandleQuota.ps1: -------------------------------------------------------------------------------- 1 | # https://docs.microsoft.com/en-us/windows/win32/sysinfo/gdi-objects 2 | # This value can be set to a number between 256 and 65,536 3 | 4 | $defaultValue = 20000 5 | Write-Host "Set the GDIProcessHandleQuota value to $defaultValue" 6 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" -Name GDIProcessHandleQuota -Value $defaultValue 7 | Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Windows" -Name GDIProcessHandleQuota -Value $defaultValue 8 | 9 | Invoke-PesterTests -TestFile "WindowsFeatures" -TestName "GDIProcessHandleQuota" 10 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Configure-Shell.ps1: -------------------------------------------------------------------------------- 1 | # Create shells folder 2 | $shellPath = "C:\shells" 3 | New-Item -Path $shellPath -ItemType Directory | Out-Null 4 | 5 | # add a wrapper for C:\msys64\usr\bin\bash.exe 6 | @' 7 | @echo off 8 | setlocal 9 | IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=strict 10 | IF NOT DEFINED MSYSTEM set MSYSTEM=mingw64 11 | set CHERE_INVOKING=1 12 | C:\msys64\usr\bin\bash.exe -leo pipefail %* 13 | '@ | Out-File -FilePath "$shellPath\msys2bash.cmd" -Encoding ascii 14 | 15 | # gitbash <--> C:\Program Files\Git\bin\bash.exe 16 | New-Item -ItemType SymbolicLink -Path "$shellPath\gitbash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" | Out-Null 17 | 18 | # wslbash <--> C:\Windows\System32\bash.exe 19 | New-Item -ItemType SymbolicLink -Path "$shellPath\wslbash.exe" -Target "$env:SystemRoot\System32\bash.exe" | Out-Null 20 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Disable-JITDebugger.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Disable Just-In-Time Debugger" 2 | 3 | # Turn off Application Error Debugger 4 | New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -Value "-" -Type String -Force 5 | New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -Value "-" -Type String -Force 6 | 7 | # Turn off the Debug dialog 8 | New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework" -Name DbgManagedDebugger -Value "-" -Type String -Force 9 | New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework" -Name DbgManagedDebugger -Value "-" -Type String -Force 10 | 11 | # Disable the WER UI 12 | New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name DontShowUI -Value 1 -Type DWORD -Force 13 | # Send all reports to the user's queue 14 | New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name ForceQueue -Value 1 -Type DWORD -Force 15 | # Default consent choice 1 - Always ask (default) 16 | New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" -Name DefaultConsent -Value 1 -Type DWORD -Force -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Enable-DeveloperMode.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Enable-DeveloperMode.ps1 3 | ## Desc: Enables Developer Mode by toggling registry setting. Developer Mode is required to enable certain tools (e.g. WinAppDriver). 4 | ################################################################################ 5 | 6 | # Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode 7 | $RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" 8 | if (-not(Test-Path -Path $RegistryKeyPath)) { 9 | New-Item -Path $RegistryKeyPath -ItemType Directory -Force 10 | } 11 | 12 | # Add registry value to enable Developer Mode 13 | New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1 14 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-AWS.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-AWS.ps1 3 | ## Desc: Install AWS tools(AWS CLI, Session Manager Plugin for the AWS CLI, AWS SAM CLI) 4 | ################################################################################ 5 | 6 | # Install AWS CLI 7 | Choco-Install -PackageName awscli 8 | 9 | # Install Session Manager Plugin for the AWS CLI 10 | $sessionManagerName = "SessionManagerPluginSetup.exe" 11 | $sessionManagerUrl = "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/windows/$sessionManagerName" 12 | Install-Binary -Url $sessionManagerUrl -Name $sessionManagerName -ArgumentList ("/silent", "/install") 13 | $env:Path = $env:Path + ";$env:ProgramFiles\Amazon\SessionManagerPlugin\bin" 14 | 15 | # Install AWS SAM CLI 16 | Install-Binary -Url "https://github.com/awslabs/aws-sam-cli/releases/latest/download/AWS_SAM_CLI_64_PY3.msi" -Name "AWS_SAM_CLI_64_PY3.msi" 17 | 18 | Invoke-PesterTests -TestFile "CLI.Tools" -TestName "AWS" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-AliyunCli.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-AliyunCli.ps1 3 | ## Desc: Install Alibaba Cloud CLI 4 | ################################################################################ 5 | 6 | Write-Host "Download Latest aliyun-cli archive" 7 | $ZipballUrl = 'https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip' 8 | $aliyunArchivePath = Start-DownloadWithRetry -Url $ZipballUrl -Name "aliyun-cli.zip" 9 | 10 | Write-Host "Expand aliyun-cli archive" 11 | $aliyunPath = "C:\aliyun-cli" 12 | New-Item -Path $aliyunPath -ItemType Directory -Force 13 | Extract-7Zip -Path $aliyunArchivePath -DestinationPath $aliyunPath 14 | 15 | # Add aliyun-cli to path 16 | Add-MachinePathItem $aliyunPath 17 | 18 | Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Aliyun CLI" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Apache.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Apache.ps1 3 | ## Desc: Install Apache HTTP Server 4 | ################################################################################ 5 | 6 | # Stop w3svc service 7 | Stop-Service -Name w3svc | Out-Null 8 | 9 | # Install latest apache in chocolatey 10 | $installDir = "C:\tools" 11 | Choco-Install -PackageName apache-httpd -ArgumentList "--force", "--params", "/installLocation:$installDir /port:80" 12 | 13 | # Stop and disable Apache service 14 | Stop-Service -Name Apache 15 | Set-Service Apache -StartupType Disabled 16 | 17 | # Start w3svc service 18 | Start-Service -Name w3svc | Out-Null 19 | 20 | # Invoke Pester Tests 21 | Invoke-PesterTests -TestFile "Apache" 22 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-AzureCli.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-AzureCli.ps1 3 | ## Desc: Install Azure CLI 4 | ################################################################################ 5 | 6 | Write-Host "Install the latest Azure CLI release" 7 | $azCliUrl = "https://aka.ms/installazurecliwindows" 8 | Install-Binary -Url $azCliUrl -Name "azure-cli.msi" 9 | 10 | $azureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory' 11 | $null = New-Item -ItemType "Directory" -Path $azureCliExtensionPath 12 | 13 | [Environment]::SetEnvironmentVariable("AZURE_EXTENSION_DIR", $azureCliExtensionPath, [System.EnvironmentVariableTarget]::Machine) 14 | 15 | Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Azure CLI" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-AzureCosmosDbEmulator.ps1: -------------------------------------------------------------------------------- 1 | #################################################################################### 2 | ## File: Install-AzureCosmosDbEmulator.ps1 3 | ## Desc: Install Azure CosmosDb Emulator 4 | #################################################################################### 5 | 6 | $InstallerName = "AzureCosmosDBEmulator.msi" 7 | $InstallerUrl = "https://aka.ms/cosmosdb-emulator" 8 | 9 | Install-Binary -Url $InstallerUrl -Name $InstallerName 10 | 11 | Invoke-PesterTests -TestFile "Tools" -TestName "Azure Cosmos DB Emulator" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-AzureDevOpsCli.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-AzureDevOpsCli.ps1 3 | ## Desc: Install Azure DevOps CLI 4 | ################################################################################ 5 | 6 | az extension add -n azure-devops 7 | 8 | Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Azure DevOps CLI" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Bazel.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Bazel.ps1 3 | ## Desc: Install Bazel and Bazelisk (A user-friendly launcher for Bazel) 4 | ################################################################################ 5 | 6 | Choco-Install -PackageName bazel 7 | 8 | npm install -g @bazel/bazelisk 9 | 10 | Invoke-PesterTests -TestFile "Tools" -TestName "Bazel" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Choco.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Set TLS1.2" 2 | [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" 3 | 4 | Write-Host "Install chocolatey" 5 | $chocoExePath = 'C:\ProgramData\Chocolatey\bin' 6 | 7 | # Add to system PATH 8 | $systemPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::Machine) 9 | $systemPath += ';' + $chocoExePath 10 | [Environment]::SetEnvironmentVariable("PATH", $systemPath, [System.EnvironmentVariableTarget]::Machine) 11 | 12 | # Update local process' path 13 | $userPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::User) 14 | if ($userPath) { 15 | $env:Path = $systemPath + ";" + $userPath 16 | } else { 17 | $env:Path = $systemPath 18 | } 19 | 20 | # Run the installer 21 | Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) 22 | 23 | # Turn off confirmation 24 | choco feature enable -n allowGlobalConfirmation 25 | 26 | # Initialize environmental variable ChocolateyToolsLocation by invoking choco Get-ToolsLocation function 27 | Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force 28 | Get-ToolsLocation 29 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-CloudFoundryCli.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-CloudFoundryCli.ps1 3 | ## Desc: Install Cloud Foundry CLI 4 | ################################################################################ 5 | 6 | # Download the latest cf cli exe 7 | $CloudFoundryCliName = "cf-cli.zip" 8 | $CloudFoundryCliUrl = "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github" 9 | 10 | $CloudFoundryArchPath = Start-DownloadWithRetry -Url $CloudFoundryCliUrl -Name $CloudFoundryCliName 11 | 12 | # Create directory for cf cli 13 | $CloudFoundryCliPath = "C:\cf-cli" 14 | New-Item -Path $CloudFoundryCliPath -ItemType Directory -Force 15 | 16 | # Extract the zip archive 17 | Write-Host "Extracting cf cli..." 18 | Extract-7Zip -Path $CloudFoundryArchPath -DestinationPath $CloudFoundryCliPath 19 | 20 | # Add cf to path 21 | Add-MachinePathItem $CloudFoundryCliPath 22 | 23 | Invoke-PesterTests -TestFile "CLI.Tools" -TestName "CloudFoundry CLI" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-CommonUtils.ps1: -------------------------------------------------------------------------------- 1 | $commonPackages = (Get-ToolsetContent).choco.common_packages 2 | 3 | foreach ($package in $commonPackages) 4 | { 5 | Choco-Install -PackageName $package.name -ArgumentList $package.args 6 | } 7 | 8 | Invoke-PesterTests -TestFile "ChocoPackages" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-DACFx.ps1: -------------------------------------------------------------------------------- 1 | #################################################################################### 2 | ## File: Install-DACFx.ps1 3 | ## Desc: Install SQL Server® Data-Tier Application Framework (DacFx) for Windows 4 | #################################################################################### 5 | 6 | $InstallerName = "DacFramework.msi" 7 | $InstallerUrl = "https://aka.ms/dacfx-msi" 8 | 9 | Install-Binary -Url $InstallerUrl -Name $InstallerName 10 | 11 | Invoke-PesterTests -TestFile "Tools" -TestName "DACFx" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Git.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Git.ps1 3 | ## Desc: Install Git for Windows 4 | ################################################################################ 5 | Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" 6 | 7 | # Install git 8 | Choco-Install -PackageName git -ArgumentList '--installargs="/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /o:PathOption=CmdTools /o:BashTerminalOption=ConHost /o:EnableSymlinks=Enabled /COMPONENTS=gitlfs"' 9 | 10 | Update-SessionEnvironment 11 | 12 | git config --system --add safe.directory "*" 13 | 14 | # Install hub 15 | Choco-Install -PackageName hub 16 | 17 | # Disable GCM machine-wide 18 | [Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine) 19 | 20 | # Add to PATH 21 | Add-MachinePathItem "C:\Program Files\Git\bin" 22 | 23 | # Add well-known SSH host keys to ssh_known_hosts 24 | ssh-keyscan -t rsa,ecdsa,ed25519 github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" 25 | ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" 26 | 27 | Invoke-PesterTests -TestFile "Git" 28 | Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Hub CLI" 29 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-GitHub-CLI.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-GitHub-CLI.ps1 3 | ## Desc: Install GitHub CLI 4 | ################################################################################ 5 | 6 | Write-Host "Get the latest gh version..." 7 | 8 | $Name = "gh_windows_amd64.msi" 9 | $Assets = (Invoke-RestMethod -Uri "https://api.github.com/repos/cli/cli/releases/latest").assets 10 | $DownloadUrl = ($Assets.browser_download_url -match "windows_amd64.msi") | Select-Object -First 1 11 | 12 | Install-Binary -Url $DownloadUrl -Name $Name 13 | 14 | Add-MachinePathItem "C:\Program Files (x86)\GitHub CLI" 15 | 16 | Invoke-PesterTests -TestFile "CLI.Tools" -TestName "GitHub CLI" 17 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-GoogleCloudSDK.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-GoogleCloudSDK.ps1 3 | ## Desc: Install Google Cloud SDK 4 | ################################################################################ 5 | 6 | # https://cloud.google.com/sdk/docs/downloads-interactive 7 | $googleCloudSDKInstaller = "https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe" 8 | $argumentList = @("/S", "/allusers", "/noreporting") 9 | Install-Binary -Url $googleCloudSDKInstaller -Name "GoogleCloudSDKInstaller.exe" -ArgumentList $argumentList 10 | 11 | Invoke-PesterTests -TestFile "Tools" -TestName "GoogleCloudSDK" 12 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Kotlin.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Kotlin.ps1 3 | ## Desc: Install Kotlin 4 | ################################################################################ 5 | 6 | # Install Kotlin 7 | $kotlinVersion = (Get-ToolsetContent).kotlin.version 8 | $kotlinBinaryName = (Get-ToolsetContent).kotlin.binary_name 9 | 10 | $kotlinDownloadUrl = Get-GitHubPackageDownloadUrl -RepoOwner "JetBrains" -RepoName "kotlin" -BinaryName $kotlinBinaryName -Version $kotlinVersion -UrlFilter "*{BinaryName}-{Version}.zip" 11 | $kotlinInstallerPath = Start-DownloadWithRetry -Url $kotlinDownloadUrl -Name "$kotlinBinaryName.zip" 12 | 13 | Write-Host "Expand Kotlin archive" 14 | $kotlinPath = "C:\tools" 15 | Extract-7Zip -Path $kotlinInstallerPath -DestinationPath $kotlinPath 16 | 17 | # Add to PATH 18 | Add-MachinePathItem "$kotlinPath\kotlinc\bin" 19 | 20 | Invoke-PesterTests -TestFile "Tools" -TestName "Kotlin" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-KubernetesTools.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-KubernetesTools.ps1 3 | ## Desc: Install tools for K8s. 4 | ################################################################################ 5 | 6 | Write-Host "Install Kind" 7 | # Choco installation can't be used because it depends on docker-desktop 8 | $url = 'https://api.github.com/repos/kubernetes-sigs/kind/releases/latest' 9 | [System.String] $kindDownloadLink = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "kind-windows-amd64$" 10 | $destFilePath = "C:\ProgramData\kind" 11 | $null = New-Item -Path $destFilePath -ItemType Directory -Force 12 | Start-DownloadWithRetry -Url $kindDownloadLink -Name "kind.exe" -DownloadPath $destFilePath 13 | Add-MachinePathItem $destFilePath 14 | 15 | Write-Host "Install Kubectl" 16 | Choco-Install -PackageName kubernetes-cli 17 | 18 | Write-Host "Install Helm" 19 | Choco-Install -PackageName kubernetes-helm 20 | 21 | Write-Host "Install Minikube" 22 | Choco-Install -PackageName minikube 23 | 24 | Invoke-PesterTests -TestFile "Tools" -TestName "KubernetesTools" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-LLVM.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-LLVM.ps1 3 | ## Desc: Install the latest stable version of llvm and clang compilers 4 | ################################################################################ 5 | 6 | $llvmVersion = (Get-ToolsetContent).llvm.version 7 | $latestChocoVersion = Get-LatestChocoPackageVersion -TargetVersion $llvmVersion -PackageName "llvm" 8 | Choco-Install -PackageName llvm -ArgumentList '--version', $latestChocoVersion 9 | 10 | Invoke-PesterTests -TestFile "LLVM" 11 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Mercurial.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Mercurial.ps1 3 | ## Desc: Install Mercurial 4 | ################################################################################ 5 | 6 | Choco-Install -PackageName hg -ArgumentList "--version", "5.0.0" 7 | 8 | $hgPath = "${env:ProgramFiles}\Mercurial\" 9 | Add-MachinePathItem $hgPath 10 | $env:Path = Get-MachinePath 11 | 12 | Invoke-PesterTests -TestFile "Tools" -TestName "Mercurial" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Mingw64.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Mingw64.ps1 3 | ## Desc: Install GNU tools for Windows 4 | ################################################################################ 5 | 6 | $toolsetVersion = (Get-ToolsetContent).mingw.version 7 | Choco-Install -PackageName mingw -ArgumentList "--version=$toolsetVersion" 8 | 9 | # Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name 10 | # and so the same command line can be used on Windows as on macOS and Linux 11 | $path = where.exe mingw32-make.exe | Get-Item 12 | Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe') 13 | 14 | Invoke-PesterTests -TestFile "Tools" -TestName "Mingw64" 15 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Miniconda.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Miniconda.ps1 3 | ## Desc: Install the latest version of Miniconda and set $env:CONDA 4 | ################################################################################ 5 | 6 | $CondaDestination = "C:\Miniconda" 7 | 8 | # Install the latest Miniconda 9 | $InstallerName = "Miniconda3-latest-Windows-x86_64.exe" 10 | $InstallerUrl = "https://repo.continuum.io/miniconda/${InstallerName}" 11 | $ArgumentList = ("/S", "/AddToPath=0", "/RegisterPython=0", "/D=$CondaDestination") 12 | 13 | Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList 14 | Set-SystemVariable -SystemVariable "CONDA" -Value $CondaDestination 15 | 16 | Invoke-PesterTests -TestFile "Miniconda" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-MongoDB.ps1: -------------------------------------------------------------------------------- 1 | #################################################################################### 2 | ## File: Install-MongoDB.ps1 3 | ## Desc: Install MongoDB 4 | #################################################################################### 5 | 6 | # Install mongodb package 7 | $toolsetVersion = (Get-ToolsetContent).mongodb.version 8 | $latestChocoPackage = Get-LatestChocoPackageVersion -TargetVersion $toolsetVersion -PackageName "mongodb" 9 | Choco-Install -PackageName mongodb -ArgumentList "--version=$latestChocoPackage" 10 | 11 | # Add mongodb to the PATH 12 | $mongodbService = "mongodb" 13 | $mongoPath = (Get-CimInstance Win32_Service -Filter "Name LIKE '$mongodbService'").PathName 14 | $mongoBin = Split-Path -Path $mongoPath.split('"')[1] 15 | Add-MachinePathItem "$mongoBin" 16 | 17 | # Wait for mongodb service running 18 | $svc = Get-Service $mongodbService 19 | $svc.WaitForStatus('Running','00:01:00') 20 | 21 | # Stop and disable mongodb service 22 | Stop-Service -Name $mongodbService 23 | Set-Service $mongodbService -StartupType Disabled 24 | 25 | Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-NET48.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-NET48.ps1 3 | ## Desc: Install .NET 4.8 4 | ################################################################################ 5 | 6 | # .NET 4.8 Dev pack 7 | $InstallerName = "ndp48-devpack-enu.exe" 8 | $InstallerUrl = "https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0307177e14752e359fde5423ab583e43/${InstallerName}" 9 | $ArgumentList = ("Setup", "/passive", "/norestart") 10 | 11 | Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList 12 | 13 | Invoke-PesterTests -TestFile "Tools" -TestName "NET48" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-NSIS.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-NSIS.ps1 3 | ## Desc: Install NSIS 4 | ################################################################################ 5 | 6 | $NsisVersion = (Get-ToolsetContent).nsis.version 7 | Install-Binary -Url "https://downloads.sourceforge.net/project/nsis/NSIS%203/${NsisVersion}/nsis-${NsisVersion}-setup.exe" -Name "nsis-${NsisVersion}-setup.exe" -ArgumentList ('/S') 8 | 9 | $NsisPath = "${env:ProgramFiles(x86)}\NSIS\" 10 | Add-MachinePathItem $NsisPath 11 | $env:Path = Get-MachinePath 12 | 13 | Invoke-PesterTests -TestFile "Tools" -TestName "NSIS" 14 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Nginx.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Nginx.ps1 3 | ## Desc: Install Nginx 4 | ################################################################################ 5 | 6 | # Stop w3svc service 7 | Stop-Service -Name w3svc | Out-Null 8 | 9 | # Install latest nginx in chocolatey 10 | $installDir = "C:\tools" 11 | Choco-Install -PackageName nginx -ArgumentList "--force", "--params", "/installLocation:$installDir /port:80" 12 | 13 | # Stop and disable Nginx service 14 | Stop-Service -Name nginx 15 | Set-Service nginx -StartupType Disabled 16 | 17 | # Start w3svc service 18 | Start-Service -Name w3svc | Out-Null 19 | 20 | # Invoke Pester Tests 21 | Invoke-PesterTests -TestFile "Nginx" 22 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-NodeLts.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-NodeLts.ps1 3 | ## Desc: Install nodejs-lts and other common node tools. 4 | ## Must run after python is configured 5 | ################################################################################ 6 | 7 | $PrefixPath = 'C:\npm\prefix' 8 | $CachePath = 'C:\npm\cache' 9 | 10 | New-Item -Path $PrefixPath -Force -ItemType Directory 11 | New-Item -Path $CachePath -Force -ItemType Directory 12 | 13 | $defaultVersion = (Get-ToolsetContent).node.default 14 | $versionToInstall = Get-LatestChocoPackageVersion -TargetVersion $defaultVersion -PackageName "nodejs" 15 | 16 | Choco-Install -PackageName nodejs -ArgumentList "--version=$versionToInstall" 17 | 18 | Add-MachinePathItem $PrefixPath 19 | $env:Path = Get-MachinePath 20 | 21 | setx npm_config_prefix $PrefixPath /M 22 | $env:npm_config_prefix = $PrefixPath 23 | 24 | npm config set cache $CachePath --global 25 | npm config set registry https://registry.npmjs.org/ 26 | 27 | $globalNpmPackages = (Get-ToolsetContent).npm.global_packages 28 | $globalNpmPackages | ForEach-Object { 29 | npm install -g $_.name 30 | } 31 | 32 | Invoke-PesterTests -TestFile "Node" 33 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-PHP.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-PHP.ps1 3 | ## Desc: Install PHP 4 | ################################################################################ 5 | 6 | # Install latest PHP in chocolatey 7 | $installDir = "c:\tools\php" 8 | $phpMajorMinor = (Get-ToolsetContent).php.version 9 | $phpVersionToInstall = Get-LatestChocoPackageVersion -TargetVersion $phpMajorMinor -PackageName "php" 10 | Choco-Install -PackageName php -ArgumentList "--params", "/InstallDir:$installDir", "--version=$phpVersionToInstall" 11 | 12 | # Install latest Composer in chocolatey 13 | Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP=$installDir" 14 | 15 | # update path to extensions and enable curl and mbstring extensions, and enable php openssl extensions. 16 | ((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"' -replace ';extension=openssl','extension=openssl') | Set-Content -Path $installDir\php.ini 17 | 18 | # Set the PHPROOT environment variable. 19 | setx PHPROOT $installDir /M 20 | 21 | # Invoke Pester Tests 22 | Invoke-PesterTests -TestFile "PHP" 23 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Pipx.ps1: -------------------------------------------------------------------------------- 1 | # Set custom directorys for pipx 2 | $env:PIPX_BIN_DIR = "${env:ProgramFiles(x86)}\pipx_bin" 3 | $env:PIPX_HOME = "${env:ProgramFiles(x86)}\pipx" 4 | 5 | # Install pipx 6 | pip install pipx 7 | 8 | # Set environment variables 9 | Add-MachinePathItem "${env:PIPX_BIN_DIR}" 10 | Set-SystemVariable -SystemVariable PIPX_BIN_DIR -Value $env:PIPX_BIN_DIR 11 | Set-SystemVariable -SystemVariable PIPX_HOME -Value $env:PIPX_HOME 12 | 13 | # Test pipx 14 | Invoke-PesterTests -TestFile "Tools" -TestName "Pipx" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-PipxPackages.ps1: -------------------------------------------------------------------------------- 1 | $pipxToolset = (Get-ToolsetContent).pipx 2 | foreach($tool in $pipxToolset) { 3 | if ($tool.python) { 4 | $pythonPath = (Get-Item -Path "${env:AGENT_TOOLSDIRECTORY}\Python\${tool.python}.*\x64\python-${tool.python}*").FullName 5 | Write-Host "Install ${tool.package} into python ${tool.python}" 6 | pipx install $tool.package --python $pythonPath 7 | } else { 8 | Write-Host "Install ${tool.package} into default python" 9 | pipx install $tool.package 10 | } 11 | } 12 | Invoke-PesterTests -TestFile "PipxPackages" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-PowerShellModules.ps1: -------------------------------------------------------------------------------- 1 | # Set TLS1.2 2 | [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" 3 | 4 | Write-Host "Setup PowerShellGet" 5 | Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force 6 | 7 | # Specifies the installation policy 8 | Set-PSRepository -InstallationPolicy Trusted -Name PSGallery 9 | 10 | # Install PowerShell modules 11 | $modules = (Get-ToolsetContent).powershellModules 12 | 13 | foreach($module in $modules) 14 | { 15 | $moduleName = $module.name 16 | Write-Host "Installing ${moduleName} module" 17 | 18 | if ($module.versions) 19 | { 20 | foreach ($version in $module.versions) 21 | { 22 | Write-Host " - $version" 23 | Install-Module -Name $moduleName -RequiredVersion $version -Scope AllUsers -SkipPublisherCheck -Force 24 | } 25 | continue 26 | } 27 | 28 | Install-Module -Name $moduleName -Scope AllUsers -SkipPublisherCheck -Force 29 | } 30 | 31 | Import-Module Pester 32 | Invoke-PesterTests -TestFile "PowerShellModules" -TestName "PowerShellModules" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-PowershellCore.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-PowershellCore.ps1 3 | ## Desc: Install PowerShell Core 4 | ################################################################################ 5 | 6 | Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet" 7 | 8 | # about_update_notifications 9 | # While the update check happens during the first session in a given 24-hour period, for performance reasons, 10 | # the notification will only be shown on the start of subsequent sessions. 11 | # Also for performance reasons, the check will not start until at least 3 seconds after the session begins. 12 | [System.Environment]::SetEnvironmentVariable("POWERSHELL_UPDATECHECK", "Off", [System.EnvironmentVariableTarget]::Machine) 13 | 14 | Invoke-PesterTests -TestFile "Tools" -TestName "PowerShell Core" 15 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-R.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-R.ps1 3 | ## Desc: Install R for Windows 4 | ################################################################################ 5 | 6 | Choco-Install R.Project 7 | Choco-Install rtools 8 | 9 | $rscriptPath = Resolve-Path "C:\Program Files\R\*\bin\x64" 10 | Add-MachinePathItem $rscriptPath 11 | Invoke-PesterTests -TestFile "Tools" -TestName "R" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Rust.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Rust.ps1 3 | ## Desc: Install Rust for Windows 4 | ################################################################################ 5 | 6 | # Rust Env 7 | $env:RUSTUP_HOME = "C:\Users\Default\.rustup" 8 | $env:CARGO_HOME = "C:\Users\Default\.cargo" 9 | 10 | # Download the latest rustup-init.exe for Windows x64 11 | # See https://rustup.rs/# 12 | $rustupPath = Start-DownloadWithRetry -Url "https://win.rustup.rs/x86_64" -Name "rustup-init.exe" 13 | 14 | # Install Rust by running rustup-init.exe (disabling the confirmation prompt with -y) 15 | & $rustupPath -y --default-toolchain=stable --profile=minimal 16 | 17 | # Add %USERPROFILE%\.cargo\bin to USER PATH 18 | Add-DefaultPathItem "%USERPROFILE%\.cargo\bin" 19 | # Add Rust binaries to the path 20 | $env:Path += ";$env:CARGO_HOME\bin" 21 | 22 | # Add i686 target for building 32-bit binaries 23 | rustup target add i686-pc-windows-msvc 24 | 25 | # Install common tools 26 | rustup component add rustfmt clippy 27 | cargo install --locked bindgen cbindgen cargo-audit cargo-outdated 28 | 29 | # Cleanup Cargo crates cache 30 | Remove-Item "${env:CARGO_HOME}\registry\*" -Recurse -Force 31 | 32 | Invoke-PesterTests -TestFile "Rust" 33 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-SQLOLEDBDriver.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-SQLOLEDBDriver.ps1 3 | ## Desc: Install SQL OLEDB Driver 4 | ################################################################################ 5 | 6 | $binaryDownloadPath = Start-DownloadWithRetry "https://go.microsoft.com/fwlink/?linkid=2183083" "msoledbsql.msi" 7 | $ArgumentList = ("/i", "$binaryDownloadPath", "ADDLOCAL=ALL", "IACCEPTMSOLEDBSQLLICENSETERMS=YES", "/qn") 8 | Install-Binary -FilePath msiexec.exe -ArgumentList $ArgumentList -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-SQLPowerShellTools.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-SQLPowerShellTools.ps1 3 | ## Desc: Install SQL PowerShell tool 4 | ################################################################################ 5 | 6 | $BaseUrl = "https://download.microsoft.com/download/B/1/7/B1783FE9-717B-4F78-A39A-A2E27E3D679D/ENU/x64" 7 | 8 | # install required MSIs 9 | $SQLSysClrTypesName = "SQLSysClrTypes.msi" 10 | $SQLSysClrTypesUrl = "${BaseUrl}/${SQLSysClrTypesName}" 11 | Install-Binary -Url $SQLSysClrTypesUrl -Name $SQLSysClrTypesName 12 | 13 | $SharedManagementObjectsName = "SharedManagementObjects.msi" 14 | $SharedManagementObjectsUrl = "${BaseUrl}/${SharedManagementObjectsName}" 15 | Install-Binary -Url $SharedManagementObjectsUrl -Name $SharedManagementObjectsName 16 | 17 | $PowerShellToolsName = "PowerShellTools.msi" 18 | $PowerShellToolsUrl = "${BaseUrl}/${PowerShellToolsName}" 19 | Install-Binary -Url $PowerShellToolsUrl -Name $PowerShellToolsName 20 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Sbt.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Sbt.ps1 3 | ## Desc: Install sbt for Windows 4 | ################################################################################ 5 | 6 | # Install the latest version of sbt. 7 | # See https://chocolatey.org/packages/sbt 8 | Choco-Install -PackageName sbt 9 | 10 | $env:SBT_HOME="${env:ProgramFiles(x86)}\sbt" 11 | 12 | # Add sbt binaries to the path 13 | Add-MachinePathItem "$env:SBT_HOME\bin" 14 | 15 | Invoke-PesterTests -TestFile "Tools" -TestName "Sbt" 16 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-ServiceFabricSDK.ps1 3 | ## Desc: Install webpicmd and then the service fabric sdk 4 | ## must be install after Visual Studio 5 | ################################################################################ 6 | 7 | #Creating 'Installer' cache folder if it doesn't exist 8 | $temp_install_dir = 'C:\Windows\Installer' 9 | New-Item -Path $temp_install_dir -ItemType Directory -Force 10 | 11 | Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force 12 | 13 | WebpiCmd.exe /Install /Products:MicrosoftAzure-ServiceFabric-CoreSDK /AcceptEula /XML:https://webpifeed.blob.core.windows.net/webpifeed/5.1/WebProductList.xml 14 | 15 | Invoke-PesterTests -TestFile "Tools" -TestName "ServiceFabricSDK" 16 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Stack.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Stack.ps1 3 | ## Desc: Install Stack for Windows 4 | ################################################################################ 5 | 6 | Write-Host "Get the latest Stack version..." 7 | $StackReleasesJson = Invoke-RestMethod "https://api.github.com/repos/commercialhaskell/stack/releases/latest" 8 | $Version = $StackReleasesJson.name.TrimStart("v") 9 | $DownloadFilePattern = "windows-x86_64.zip" 10 | $DownloadUrl = $StackReleasesJson.assets | Where-Object { $_.name.EndsWith($DownloadFilePattern) } | Select-Object -ExpandProperty "browser_download_url" -First 1 11 | 12 | Write-Host "Download stack archive" 13 | $StackToolcachePath = Join-Path $Env:AGENT_TOOLSDIRECTORY "stack\$Version" 14 | $DestinationPath = Join-Path $StackToolcachePath "x64" 15 | $StackArchivePath = Start-DownloadWithRetry -Url $DownloadUrl 16 | 17 | Write-Host "Expand stack archive" 18 | Extract-7Zip -Path $StackArchivePath -DestinationPath $DestinationPath 19 | 20 | New-Item -Name "x64.complete" -Path $StackToolcachePath 21 | 22 | Add-MachinePathItem -PathItem $DestinationPath 23 | 24 | Invoke-PesterTests -TestFile "Tools" -TestName "Stack" 25 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-VCRedist.ps1: -------------------------------------------------------------------------------- 1 | # Install vcredist2010 2 | $Vc2010x86Name = "vcredist_x86.exe" 3 | $Vc2010x86URI = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/${Vc2010x86Name}" 4 | $Vc2010x64Name = "vcredist_x64.exe" 5 | $Vc2010x64URI = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/${Vc2010x64Name}" 6 | $ArgumentList = ("/install", "/quiet", "/norestart") 7 | Install-Binary -Url $Vc2010x86URI -Name $Vc2010x86Name -ArgumentList $ArgumentList 8 | Install-Binary -Url $Vc2010x64URI -Name $Vc2010x64Name -ArgumentList $ArgumentList 9 | 10 | Invoke-PesterTests -TestFile "Tools" -TestName "VCRedist" 11 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Vcpkg.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Vcpkg.ps1 3 | ## Desc: Install vcpkg 4 | ################################################################################ 5 | 6 | $Uri = 'https://github.com/Microsoft/vcpkg.git' 7 | $InstallDir = 'C:\vcpkg' 8 | $VcpkgExecPath = 'vcpkg.exe' 9 | 10 | git clone $Uri $InstallDir -q 11 | 12 | # Build and integrate vcpkg 13 | Invoke-Expression "$InstallDir\bootstrap-vcpkg.bat" 14 | Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install" 15 | 16 | # Add vcpkg to system environment 17 | Add-MachinePathItem $InstallDir 18 | $env:Path = Get-MachinePath 19 | setx VCPKG_INSTALLATION_ROOT $InstallDir /M 20 | 21 | Invoke-PesterTests -TestFile "Tools" -TestName "Vcpkg" 22 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Vsix.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################### 2 | ## File: Install-Vsix.ps1 3 | ## Desc: Install the Visual Studio Extensions from toolset.json 4 | ################################################################################### 5 | 6 | $toolset = Get-ToolsetContent 7 | $vsixPackagesList = $toolset.visualStudio.vsix 8 | if (-not $vsixPackagesList) { 9 | Write-Host "No extensions to install" 10 | exit 0 11 | } 12 | 13 | $vsVersion = $toolset.visualStudio.Version 14 | $vsixPackagesList | ForEach-Object { 15 | # Retrieve cdn endpoint to avoid HTTP error 429 https://github.com/actions/virtual-environments/issues/3074 16 | $vsixPackage = Get-VsixExtenstionFromMarketplace -ExtensionMarketPlaceName $_ 17 | if ($vsixPackage.FileName.EndsWith(".vsix")) { 18 | Install-VsixExtension -Url $vsixPackage.DownloadUri -Name $vsixPackage.FileName -VSversion $vsVersion 19 | } else { 20 | $argumentList = ('/install', '/quiet', '/norestart') 21 | Install-Binary -Url $vsixPackage.DownloadUri -Name $vsixPackage.FileName -ArgumentList $argumentList 22 | } 23 | } 24 | 25 | Invoke-PesterTests -TestFile "Vsix" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-WebPlatformInstaller.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-WebPI.ps1 3 | ## Desc: Install WebPlatformInstaller 4 | ################################################################################ 5 | 6 | # Download and install WebPlatformInstaller 7 | $webPlatformInstallerFile = "WebPlatformInstaller_x64_en-US.msi" 8 | $webPlatformInstallerUrl = "http://go.microsoft.com/fwlink/?LinkId=287166" 9 | Install-Binary -Url $webPlatformInstallerUrl -Name $webPlatformInstallerFile 10 | 11 | Invoke-PesterTests -TestFile "Tools" -TestName "WebPlatformInstaller" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-WinAppDriver.ps1: -------------------------------------------------------------------------------- 1 | #################################################################################### 2 | ## File: Install-WinAppDriver.ps1 3 | ## Desc: Install Windows Application Driver (WinAppDriver) 4 | #################################################################################### 5 | 6 | $LatestReleaseUrl = 'https://api.github.com/repos/microsoft/WinAppDriver/releases/latest' 7 | $InstallerUrl = (Invoke-RestMethod -Uri $LatestReleaseUrl).assets.browser_download_url 8 | $InstallerName = "WindowsApplicationDriver.msi" 9 | 10 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 11 | Install-Binary -Url $InstallerUrl -Name $InstallerName 12 | 13 | Invoke-PesterTests -TestFile "WinAppDriver" -TestName "WinAppDriver" 14 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-WindowsFeatures.ps1: -------------------------------------------------------------------------------- 1 | $windowsFeatures = (Get-ToolsetContent).windowsFeatures 2 | 3 | foreach ($feature in $windowsFeatures) { 4 | if ($feature.optionalFeature) { 5 | Write-Host "Activating Windows Optional Feature '$($feature.name)'..." 6 | Enable-WindowsOptionalFeature -Online -FeatureName $feature.name -NoRestart 7 | 8 | $resultSuccess = $? 9 | } else { 10 | Write-Host "Activating Windows Feature '$($feature.name)'..." 11 | $Arguments = @{ 12 | Name = $feature.name 13 | IncludeAllSubFeature = [System.Convert]::ToBoolean($feature.includeAllSubFeatures) 14 | IncludeManagementTools = [System.Convert]::ToBoolean($feature.includeManagementTools) 15 | } 16 | $result = Install-WindowsFeature @Arguments 17 | 18 | $resultSuccess = $result.Success 19 | } 20 | 21 | if ($resultSuccess) { 22 | Write-Host "Windows Feature '$($feature.name)' was activated successfully" 23 | } else { 24 | throw "Failed to activate Windows Feature '$($feature.name)'" 25 | } 26 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Wix.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-Wix.ps1 3 | ## Desc: Install WIX. 4 | ################################################################################ 5 | 6 | Choco-Install -PackageName wixtoolset -ArgumentList "--force" 7 | 8 | Invoke-PesterTests -TestFile "Wix" 9 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Install-Zstd.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Install-zstd.ps1 3 | ## Desc: Install zstd 4 | ################################################################################ 5 | 6 | $url = "https://api.github.com/repos/facebook/zstd/releases/latest" 7 | # Explicitly set type to string since match returns array by default 8 | [System.String] $zstdLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "zstd-.+-win64.zip$" 9 | $zstdArchivePath = Start-DownloadWithRetry -Url $zstdLatest -Name "zstd-win64.zip" 10 | 11 | $toolPath = "C:\tools" 12 | $zstdPath = Join-Path $toolPath zstd 13 | $zstdParentName = [IO.Path]::GetFileNameWithoutExtension($zstdLatest) 14 | $filesInArchive = 7z l $zstdArchivePath | Out-String 15 | 16 | if ($filesInArchive.Contains($zstdParentName)) { 17 | Extract-7Zip -Path $zstdArchivePath -DestinationPath $toolPath 18 | Invoke-SBWithRetry -Command { 19 | Move-Item -Path "${zstdPath}*" -Destination $zstdPath -ErrorAction Stop 20 | } 21 | } else { 22 | Extract-7Zip -Path $zstdArchivePath -DestinationPath $zstdPath 23 | } 24 | 25 | # Add zstd-win64 to PATH 26 | Add-MachinePathItem $zstdPath 27 | 28 | Invoke-PesterTests -TestFile "Tools" -TestName "Zstd" 29 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Run-NGen.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "NGen: Microsoft.PowerShell.Utility.Activities" 2 | $null = & $env:SystemRoot\Microsoft.NET\Framework64\v4.0.30319\ngen.exe install "Microsoft.PowerShell.Utility.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 3 | Write-Host "NGen: Framework64" 4 | $null = & $env:SystemRoot\Microsoft.NET\Framework64\v4.0.30319\ngen.exe update 5 | Write-Host "NGen: Framework" 6 | $null = & $env:SystemRoot\Microsoft.NET\Framework\v4.0.30319\ngen.exe update -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Update-DotnetTLS.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Update-DotnetTLS.ps1 3 | ## Desc: Update DotNetFramework security protocol to TLS 1.2 4 | ################################################################################ 5 | 6 | $registryPath = "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" 7 | $name = "SchUseStrongCrypto" 8 | $value = "1" 9 | if(Test-Path $registryPath){ 10 | Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD 11 | } 12 | 13 | $registryPath = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" 14 | if(Test-Path $registryPath){ 15 | Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD 16 | } 17 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Installers/Wait-WindowsUpdatesForInstall.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: Wait-WindowsUpdatesForInstall.ps1 3 | ## Desc: Wait for installation windows updates to complete 4 | ################################################################################ 5 | 6 | Invoke-SBWithRetry -RetryCount 10 -RetryIntervalSeconds 120 -Command { 7 | $inProgress = Get-WindowsUpdatesHistory | Where-Object Status -eq "InProgress" 8 | if ( $inProgress ) { 9 | $title = $inProgress.Title -join "`n" 10 | throw "InProgress: $title" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/README.md: -------------------------------------------------------------------------------- 1 | Common scripts for all Windows images regardless of Visual Studio or OS version 2 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/SoftwareReport/SoftwareReport.Java.psm1: -------------------------------------------------------------------------------- 1 | function Get-JavaVersions { 2 | $defaultJavaPath = $env:JAVA_HOME 3 | $javaVersions = Get-Item env:JAVA_HOME_*_X64 4 | $sortRules = @{ 5 | Expression = { [Int32]$_.Name.Split("_")[2] } 6 | Descending = $false 7 | } 8 | 9 | return $javaVersions | Sort-Object $sortRules | ForEach-Object { 10 | $javaPath = $_.Value 11 | # Take semver from the java path 12 | # The path contains '-' sign in the version number instead of '+' due to the following issue, need to substitute it back https://github.com/actions/virtual-environments/issues/3014 13 | $versionInPath = (Split-Path $javaPath) -replace "\w:\\.*\\" 14 | $version = $versionInPath -replace '-', '+' 15 | $defaultPostfix = ($javaPath -eq $defaultJavaPath) ? " (default)" : "" 16 | $VendorName = ($javaPath -like '*Java_Adopt_jdk*') ? "Adopt OpenJDK" : "Eclipse Temurin" 17 | 18 | [PSCustomObject] @{ 19 | "Version" = $version + $defaultPostfix 20 | "Vendor" = $VendorName 21 | "Environment Variable" = $_.Name 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Apache.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Apache" { 2 | Context "Path" { 3 | It "Apache" { 4 | $apachePath = Join-Path (Join-Path "C:\tools\" (Get-Item C:\tools\apache*).Name) "\bin\httpd" 5 | "$apachePath -V" | Should -ReturnZeroExitCode 6 | } 7 | } 8 | 9 | Context "Service" { 10 | $apacheService = Get-Service -Name Apache 11 | $apacheServiceTests = @{ 12 | Name = $apacheService.Name 13 | Status = $apacheService.Status 14 | StartType = $apacheService.StartType 15 | } 16 | 17 | It " service is stopped" -TestCases $apacheServiceTests { 18 | $Status | Should -Be "Stopped" 19 | } 20 | 21 | It " service is disabled" -TestCases $apacheServiceTests { 22 | $StartType | Should -Be "Disabled" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/BizTalk.Tests.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## File: BizTalk.Tests.ps1 3 | ## Desc: Test BizTalk project build component installed. 4 | ################################################################################ 5 | 6 | Describe "BizTalk Build Component Setup" -Skip:(-not (Test-IsWin19)) { 7 | It "BizTalk Registry Check" { 8 | Test-Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\BizTalk Server\3.0" | Should -BeTrue 9 | } 10 | 11 | It "BizTalk Folder Check" { 12 | "${env:ProgramFiles(x86)}\Microsoft BizTalk Server" | Should -Exist 13 | } 14 | 15 | It "BizTalk Build Targets files Check" { 16 | "${env:ProgramFiles(x86)}\MSBuild\Microsoft\BizTalk\BizTalkC.targets" | Should -Exist 17 | "${env:ProgramFiles(x86)}\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets" | Should -Exist 18 | } 19 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/CLI.Tools.Tests.ps1: -------------------------------------------------------------------------------- 1 | 2 | Describe "Azure CLI" { 3 | It "Azure CLI" { 4 | "az --version" | Should -ReturnZeroExitCode 5 | } 6 | } 7 | 8 | Describe "Azure DevOps CLI" { 9 | It "az devops" { 10 | "az devops -h" | Should -ReturnZeroExitCode 11 | } 12 | } 13 | 14 | Describe "Aliyun CLI" { 15 | It "Aliyun CLI" { 16 | "aliyun version" | Should -ReturnZeroExitCode 17 | } 18 | } 19 | 20 | 21 | Describe "AWS" { 22 | It "AWS CLI" { 23 | "aws --version" | Should -ReturnZeroExitCode 24 | } 25 | 26 | It "Session Manager Plugin for the AWS CLI" { 27 | session-manager-plugin | Out-String | Should -Match "plugin was installed successfully" 28 | } 29 | 30 | It "AWS SAM CLI" { 31 | "sam --version" | Should -ReturnZeroExitCode 32 | } 33 | } 34 | 35 | 36 | Describe "GitHub CLI" { 37 | It "gh" { 38 | "gh --version" | Should -ReturnZeroExitCode 39 | } 40 | } 41 | 42 | Describe "CloudFoundry CLI" -Skip:(Test-IsWin22) { 43 | It "cf is located in C:\cf-cli" { 44 | "C:\cf-cli\cf.exe" | Should -Exist 45 | } 46 | 47 | It "cf" { 48 | "cf --version" | Should -ReturnZeroExitCode 49 | } 50 | } 51 | 52 | Describe "Hub CLI" { 53 | It "hub is installed" { 54 | "hub --version" | Should -ReturnZeroExitCode 55 | } 56 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Docker.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Docker" { 2 | It "" -TestCases @( 3 | @{ ToolName = "docker" } 4 | @{ ToolName = "docker-compose" } 5 | ) { 6 | "$ToolName --version" | Should -ReturnZeroExitCode 7 | } 8 | 9 | It "docker-wincred" { 10 | "docker-credential-wincred version" | Should -ReturnZeroExitCode 11 | } 12 | 13 | It "docker compose v2" { 14 | "docker compose version" | Should -ReturnZeroExitCode 15 | } 16 | 17 | It "docker service is up" { 18 | "docker images" | Should -ReturnZeroExitCode 19 | } 20 | } 21 | 22 | Describe "DockerImages" { 23 | Context "docker images" { 24 | $testCases = (Get-ToolsetContent).docker.images | ForEach-Object { @{ ImageName = $_ } } 25 | 26 | It "" -TestCases $testCases { 27 | docker images "$ImageName" --format "{{.Repository}}" | Should -Not -BeNullOrEmpty 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/DotnetSDK.Tests.ps1: -------------------------------------------------------------------------------- 1 | $dotnetVersions = (Get-ToolsetContent).dotnet.versions 2 | $dotnetTools = (Get-ToolsetContent).dotnet.tools 3 | 4 | Describe "Dotnet SDK and tools" { 5 | 6 | Context "Default" { 7 | It "Default Dotnet SDK is available" { 8 | "dotnet --version" | Should -ReturnZeroExitCode 9 | } 10 | } 11 | 12 | foreach ($version in $dotnetVersions) { 13 | Context "Dotnet $version" { 14 | $dotnet = @{ dotnetVersion = $version } 15 | 16 | It "SDK $version is available" -TestCases $dotnet { 17 | (dotnet --list-sdks | Where-Object { $_ -match "${dotnetVersion}\.[0-9]*" }).Count | Should -BeGreaterThan 0 18 | } 19 | 20 | It "Runtime $version is available" -TestCases $dotnet { 21 | (dotnet --list-runtimes | Where-Object { $_ -match "${dotnetVersion}\.[0-9]*" }).Count | Should -BeGreaterThan 0 22 | } 23 | } 24 | } 25 | 26 | Context "Dotnet tools" { 27 | $env:Path += ";C:\Users\Default\.dotnet\tools" 28 | $testCases = $dotnetTools | ForEach-Object { @{ ToolName = $_.name; TestInstance = $_.test }} 29 | 30 | It " is available" -TestCases $testCases { 31 | "$TestInstance" | Should -ReturnZeroExitCode 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Git.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Git" { 2 | $gitTools = 'bash', 'awk', 'git', 'git-lfs' 3 | $gitTestCases = $gitTools | ForEach-Object { 4 | @{ 5 | toolName = $_ 6 | source = [regex]::Escape("$env:ProgramFiles\Git") 7 | } 8 | } 9 | 10 | It " is installed" -TestCases $gitTestCases { 11 | "$toolName --version" | Should -ReturnZeroExitCode 12 | } 13 | 14 | It " is located in ''" -TestCases $gitTestCases { 15 | (Get-Command -Name $toolName).Source | Should -Match $source 16 | } 17 | 18 | It "Git core.symlinks=true option is enabled" { 19 | git config core.symlinks | Should -BeExactly true 20 | } 21 | 22 | It "GCM_INTERACTIVE environment variable should be equal Never" { 23 | $env:GCM_INTERACTIVE | Should -BeExactly Never 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/LLVM.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Clang/LLVM" { 2 | BeforeAll { 3 | $toolsetVersion = (Get-ToolsetContent).llvm.version 4 | } 5 | 6 | It "Clang/LLVM installed and version is correct" { 7 | $clangVersion = clang --version 8 | $clangVersion[0] | Should -BeLike "*${toolsetVersion}*" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Miniconda.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Miniconda" { 2 | It "Miniconda Environment variables is set. " { 3 | ${env:CONDA} | Should -Not -BeNullOrEmpty 4 | } 5 | 6 | It "Miniconda $env:CONDA\ " -TestCases @( 7 | @{ PathTest = "python.exe" } 8 | @{ PathTest = "Scripts\conda.exe" } 9 | ) { 10 | $condaPath = Join-Path ${env:CONDA} $PathTest 11 | $condaPath | Should -Exist 12 | "$condaPath --version" | Should -ReturnZeroExitCode 13 | } 14 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Nginx.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Nginx" { 2 | Context "Path" { 3 | It "Nginx" { 4 | $nginxPath = Join-Path (Join-Path "C:\tools\" (Get-Item C:\tools\nginx*).Name) "nginx" 5 | "$nginxPath -v" | Should -ReturnZeroExitCode 6 | } 7 | } 8 | 9 | Context "Service" { 10 | $nginxService = Get-Service -Name nginx 11 | $nginxServiceTests = @{ 12 | Name = $nginxService.Name 13 | Status = $nginxService.Status 14 | StartType = $nginxService.StartType 15 | } 16 | 17 | It " service is stopped" -TestCases $nginxServiceTests { 18 | $Status | Should -Be "Stopped" 19 | } 20 | 21 | It " service is disabled" -TestCases $nginxServiceTests { 22 | $StartType | Should -Be "Disabled" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Node.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Node.JS" { 2 | Context "Basic modules"{ 3 | It " " -TestCases @( 4 | @{ ToolName = "node" } 5 | @{ ToolName = "npm" } 6 | ) { 7 | "$ToolName --version" | Should -ReturnZeroExitCode 8 | } 9 | } 10 | 11 | $globalNpmPackages = (Get-ToolsetContent).npm.global_packages 12 | $globalNpmPackagesWithTests = $globalNpmPackages | Where-Object { $_.test } | ForEach-Object { @{ Name = $_.name; Test = $_.test } } 13 | 14 | Context "Global NPM Packages" { 15 | It "" -TestCases $globalNpmPackagesWithTests { 16 | $Test | Should -ReturnZeroExitCode 17 | } 18 | } 19 | 20 | Context "Node.js version" { 21 | It "Node.js version should correspond to the version in the toolset" { 22 | node --version | Should -BeLike "v$((Get-ToolsetContent).node.default)*" 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/PHP.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "PHP" { 2 | It "Check PHP version" { 3 | $phpMajorMinor = (Get-ToolsetContent).php.version 4 | $phpInstalledVersion = php --version | Select-String -Pattern "PHP $phpMajorMinor" 5 | $phpInstalledVersion | Should -BeLike "*${phpMajorMinor}*" 6 | } 7 | 8 | It "Check Composer in the PATH" { 9 | "composer --version" | Should -ReturnZeroExitCode 10 | } 11 | 12 | It "PHP Environment variables is set." { 13 | ${env:PHPROOT} | Should -Not -BeNullOrEmpty 14 | ${env:PHPROOT} | Should -Exist 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/PipxPackages.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "PipxPackages" { 2 | $pipxToolset = (Get-ToolsetContent).pipx 3 | $testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} } 4 | It "" -TestCases $testCases { 5 | "$cmd" | Should -ReturnZeroExitCode 6 | } 7 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/RunAll-Tests.ps1: -------------------------------------------------------------------------------- 1 | Invoke-PesterTests "*" -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/SSDTExtensions.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "SSDTExtensions" { 2 | #These extensions don't have any proper name in the state.packages.json file, only id is available, which can be found on extension marketplace download page 3 | 4 | if (Test-isWin19) { 5 | $testExtenions = @( 6 | @{id = "04a86fc2-dbd5-4222-848e-911638e487fe"} 7 | @{id = "851E7A09-7B2B-4F06-A15D-BABFCB26B970"} 8 | @{id = "717ad572-c4b7-435c-c166-c2969777f718"} 9 | ) 10 | 11 | It "Extensions id=" -TestCases $testExtenions { 12 | $version = Get-VSExtensionVersion -packageName "${id}" 13 | $version | Should -Not -BeNullOrEmpty 14 | } 15 | } else { 16 | It "Extension SSDT" { 17 | $version = Get-VSExtensionVersion -packageName "SSDT" 18 | $version | Should -Not -BeNullOrEmpty 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Shell.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Shell" { 2 | $shellTestCases = @( 3 | @{Name = "C:\shells\gitbash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"}, 4 | @{Name = "C:\shells\msys2bash.cmd"; Target = $null} 5 | ) 6 | if (Test-IsWin19) { 7 | $shellTestCases += @{Name = "C:\shells\wslbash.exe"; Target = "$env:SystemRoot\System32\bash.exe"} 8 | } 9 | 10 | It " target to " -TestCases $shellTestCases { 11 | (Get-Item $Name).Target | Should -BeExactly $Target 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/VisualStudio.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Visual Studio" { 2 | Context "Basic" { 3 | It "Catalog.json" { 4 | Get-VsCatalogJsonPath | Should -Exist 5 | } 6 | 7 | It "Devenv.exe" { 8 | $vsInstallRoot = (Get-VisualStudioInstance).InstallationPath 9 | $devenvexePath = "${vsInstallRoot}\Common7\IDE\devenv.exe" 10 | $devenvexePath | Should -Exist 11 | } 12 | } 13 | 14 | Context "Visual Studio components" { 15 | $expectedComponents = Get-ToolsetContent | Select-Object -ExpandProperty visualStudio | Select-Object -ExpandProperty workloads 16 | $testCases = $expectedComponents | ForEach-Object { @{ComponentName = $_} } 17 | BeforeAll { 18 | $installedComponents = Get-VisualStudioComponents | Select-Object -ExpandProperty Package 19 | } 20 | 21 | It "" -TestCases $testCases { 22 | $installedComponents | Should -Contain $ComponentName 23 | } 24 | } 25 | } 26 | 27 | Describe "Windows 10 SDK" { 28 | It "Verifies 17763 SDK is installed" -Skip:(Test-IsWin19) { 29 | "${env:ProgramFiles(x86)}\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.17763.0\UAP.props" | Should -Exist 30 | } 31 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Vsix.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Vsix" { 2 | $toolset = Get-ToolsetContent 3 | $requiredVsixs = $toolset.visualStudio.vsix 4 | 5 | $allPackages = (Get-VisualStudioInstance).Packages 6 | $testCases = $requiredVsixs | ForEach-Object { 7 | $vsix = Get-VsixExtenstionFromMarketplace -ExtensionMarketPlaceName $_ 8 | @{ 9 | VsixName = $vsix.ExtensionName 10 | VsixId = $vsix.VsixId 11 | AllPackages = $allPackages 12 | } 13 | } 14 | if ($testCases.Count -gt 0) { 15 | It "Extension is installed" -TestCases $testCases { 16 | $objVsix = $AllPackages | Where-Object { $_.id -eq $VsixId } 17 | $objVsix | Should -Not -BeNullOrEmpty 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/WDK.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "WDK" { 2 | It "WDK exists" { 3 | $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" 4 | $installedApplications = Get-ItemProperty -Path $regKey 5 | $WDKVersion = $installedApplications | Where-Object DisplayName -eq 'Windows Driver Kit' | Select-Object -First 1 -ExpandProperty DisplayVersion 6 | $WDKVersion | Should -Not -BeNullOrEmpty 7 | } 8 | 9 | It "Windows Driver Kit VSIX extension" -Skip:(Test-IsWin22) { 10 | $version = Get-VSExtensionVersion -packageName "Microsoft.Windows.DriverKit" 11 | $version | Should -Not -BeNullOrEmpty 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/WinAppDriver.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "WinAppDriver" { 2 | It "WinAppDriver directory exists" { 3 | Test-Path -Path "${env:ProgramFiles(x86)}\Windows Application Driver" | Should -BeTrue 4 | } 5 | } 6 | 7 | Describe "Developer Mode" { 8 | It "Developer Mode is enabled" { 9 | $path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"; 10 | Get-ItemProperty -Path $path | Select-Object -ExpandProperty "AllowDevelopmentWithoutDevLicense" | Should -Be 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.github-actions/images/win/scripts/Tests/Wix.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Wix" { 2 | BeforeAll { 3 | $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" 4 | $installedApplications = Get-ItemProperty -Path $regKey 5 | $version = ($installedApplications | Where-Object { $_.BundleCachePath -imatch ".*\\WiX\d*\.exe$" } | Select-Object -First 1).DisplayName 6 | } 7 | 8 | It "Wix Toolset version from registry" { 9 | $version | Should -Not -BeNullOrEmpty 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Disable-RealTimeMonitoring.ps1: -------------------------------------------------------------------------------- 1 | Set-MpPreference -DisableRealtimeMonitoring $true -------------------------------------------------------------------------------- /Docker/Install-DockerDesktop.ps1: -------------------------------------------------------------------------------- 1 | choco install docker-desktop 2 | -------------------------------------------------------------------------------- /Docker/Install-DockerTools.ps1: -------------------------------------------------------------------------------- 1 | choco install docker-engine docker-cli docker-compose rancher-desktop -------------------------------------------------------------------------------- /Install-AzureTools.ps1: -------------------------------------------------------------------------------- 1 | ## Azure Service Bus Explorer & Storage Explorer 2 | 3 | choco install azure-cli 4 | 5 | choco install ServiceBusExplorer 6 | choco install microsoftazurestorageexplorer -------------------------------------------------------------------------------- /Install-Boxstarter.ps1: -------------------------------------------------------------------------------- 1 | Write-Output "Bootstrapping BoxStarter" 2 | 3 | Invoke-Expression ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/mwrock/boxstarter/master/BuildScripts/bootstrapper.ps1')) 4 | Get-Boxstarter -Force -------------------------------------------------------------------------------- /Install-CollaborationTools.ps1: -------------------------------------------------------------------------------- 1 | choco install zoom 2 | 3 | choco install microsoft-teams.install -------------------------------------------------------------------------------- /Install-CosmosDb.ps1: -------------------------------------------------------------------------------- 1 | 2 | # Emulator for local development 3 | 4 | choco install azure-cosmosdb-emulator 5 | 6 | # For migrating data between systems 7 | 8 | # Didn't work 9 | 10 | # choco install azure-documentdb-data-migration-tool 11 | -------------------------------------------------------------------------------- /Install-DevTools.ps1: -------------------------------------------------------------------------------- 1 | ## Development Tools - General 2 | 3 | choco install postman 4 | choco install baretail 5 | 6 | choco install conemu 7 | 8 | choco install sqlitebrowser 9 | 10 | choco install winmerge 11 | 12 | choco install rdcman -------------------------------------------------------------------------------- /Install-Dotfiles.ps1: -------------------------------------------------------------------------------- 1 | 2 | # Depends on git being installed 3 | 4 | git clone https://github.com/mattgwagner/dotfiles.git "$Home/.dotfiles" 5 | 6 | & "$Home/.dotfiles/Install-Profile.ps1" -------------------------------------------------------------------------------- /Install-DotnetCore.ps1: -------------------------------------------------------------------------------- 1 | $Version = "LTS" #options: latest, LTS, 2.2, 3.1 2 | 3 | $ScriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition 4 | 5 | $Script = ((New-Object System.Net.WebClient).DownloadString('https://dot.net/v1/dotnet-install.ps1')) 6 | 7 | $Path = "$ScriptPath/_Install-DotnetCore.ps1" 8 | 9 | Add-Content $Path $Script 10 | 11 | & $Path -Channel $Version 12 | 13 | Remove-Item $Path 14 | 15 | RefreshEnv 16 | 17 | dotnet tool install --global dotnet-ef -------------------------------------------------------------------------------- /Install-GitTools.ps1: -------------------------------------------------------------------------------- 1 | if($IsWindows) 2 | { 3 | ## Development Tools - Git 4 | 5 | choco install TortoiseGit 6 | choco install github-desktop 7 | choco install git-credential-winstore 8 | choco install gh 9 | 10 | mkdir "$($env:USERPROFILE)\.ssh" # Create .ssh folder for keys 11 | 12 | Get-Service -Name ssh-agent | Set-Service -StartupType Manual 13 | 14 | $env:GIT_SSH = "C:\WINDOWS\System32\OpenSSH\ssh.exe" 15 | 16 | } 17 | 18 | Write-Output "Installing PoshGit" 19 | 20 | PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force -------------------------------------------------------------------------------- /Install-GoTools.ps1: -------------------------------------------------------------------------------- 1 | choco install golang 2 | -------------------------------------------------------------------------------- /Install-Java.ps1: -------------------------------------------------------------------------------- 1 | choco install oraclejdk 2 | 3 | # Set JAVA_HOME = c:\program files\java\jdk-14.0.2 or similar 4 | # Add %JAVA_HOME%\bin to your path 5 | 6 | choco install gradle 7 | 8 | choco install intellijidea -------------------------------------------------------------------------------- /Install-MongoTools.ps1: -------------------------------------------------------------------------------- 1 | 2 | ## Development Tools - Mongo 3 | 4 | choco install mongodb 5 | choco install robo3t.install 6 | -------------------------------------------------------------------------------- /Install-MySql.ps1: -------------------------------------------------------------------------------- 1 | choco install mysql 2 | choco install mysql.workbench 3 | -------------------------------------------------------------------------------- /Install-NodeTools.ps1: -------------------------------------------------------------------------------- 1 | ## Development Tools - Node.JS & Yarn 2 | 3 | choco install nvm 4 | 5 | choco install yarn 6 | 7 | RefreshEnv 8 | 9 | nvm install latest 10 | 11 | choco install visualstudio2019-workload-node -------------------------------------------------------------------------------- /Install-OneDrive.ps1: -------------------------------------------------------------------------------- 1 | choco install onedrive -------------------------------------------------------------------------------- /Install-PgpTools.ps1: -------------------------------------------------------------------------------- 1 | ### 2 | ### Install gpg4win, including the Kleopatra UI for signing/encrypting/decrypting data. 3 | ### 4 | 5 | choco install gpg4win 6 | -------------------------------------------------------------------------------- /Install-PostgreSql.ps1: -------------------------------------------------------------------------------- 1 | choco install postgresql 2 | 3 | choco install pgadmin3 4 | -------------------------------------------------------------------------------- /Install-PythonTools.ps1: -------------------------------------------------------------------------------- 1 | ### 2 | ### Install Python runtime and tooling 3 | ### 4 | 5 | choco install python 6 | 7 | choco install pip 8 | 9 | choco install visualstudio2019-workload-python 10 | -------------------------------------------------------------------------------- /Install-ReactNative.ps1: -------------------------------------------------------------------------------- 1 | choco install android-sdk 2 | 3 | choco install androidstudio 4 | 5 | ## This is also installed via Install-NodeTools.ps1 6 | 7 | choco install yarn 8 | 9 | yarn add global expo-cli 10 | 11 | yarn add global react-native-cli 12 | -------------------------------------------------------------------------------- /Install-VisualStudio2022.ps1: -------------------------------------------------------------------------------- 1 | choco install visualstudio2022community --package-parameters "--allWorkloads --includeRecommended --passive" 2 | -------------------------------------------------------------------------------- /Install-VsCode.ps1: -------------------------------------------------------------------------------- 1 | ### 2 | ### Install Visual Studio Code via Chocolatey and my preferred extensions 3 | ### 4 | 5 | $Extensions = @( 6 | 'ms-dotnettools.csdevkit' 7 | 'github.codespaces', 8 | 'ms-vscode.powershell', 9 | 'ms-azuretools.vscode-docker', 10 | 'eamodio.gitlens', 11 | 'ms-mssql.mssql', 12 | 'esbenp.prettier-vscode' 13 | ) 14 | 15 | choco install vscode 16 | 17 | foreach($Extension in $Extensions) 18 | { 19 | Write-Output "Installing VSCode Extension $Extension" 20 | 21 | & "C:\Program Files\Microsoft VS Code\bin\code.cmd" --install-extension $Extension 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Matt Wagner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MacOS/.zshrc: -------------------------------------------------------------------------------- 1 | eval $(/opt/homebrew/bin/brew shellenv) -------------------------------------------------------------------------------- /MacOS/Install-DevTools.sh: -------------------------------------------------------------------------------- 1 | brew install --cask powershell 2 | 3 | brew install --cask visual-studio-code 4 | 5 | brew install --cask azure-data-studio 6 | 7 | brew install node 8 | 9 | brew install --cask github 10 | -------------------------------------------------------------------------------- /MacOS/Install-Docker.sh: -------------------------------------------------------------------------------- 1 | 2 | brew install docker-machine docker-compose docker 3 | 4 | brew cask install docker 5 | -------------------------------------------------------------------------------- /MacOS/README.md: -------------------------------------------------------------------------------- 1 | # Apps Currently In Use (Look to Sync with Brewfile) 2 | 3 | - Flux 4 | - Google Drive 5 | - KeepingYouAwake 6 | - Mail (built-in) 7 | - Microsoft Remote Desktop 8 | - Microsoft Teams 9 | - Notion 10 | - Spotify? 11 | - Rectangle (move, quadrant windows) 12 | - VSCode 13 | - zoom.us 14 | -------------------------------------------------------------------------------- /MacOS/Setup.sh: -------------------------------------------------------------------------------- 1 | # Install Homebrew via shell script 2 | 3 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 4 | 5 | # Add to .zshrc -> eval $(/opt/homebrew/bin/brew shellenv) 6 | 7 | # Require password as soon as screensaver or sleep mode starts 8 | defaults write com.apple.screensaver askForPassword -int 1 9 | defaults write com.apple.screensaver askForPasswordDelay -int 0 10 | 11 | # Show filename extensions by default 12 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 13 | 14 | # Disable "natural" scroll 15 | defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false 16 | 17 | brew tap "homebrew/bundle" 18 | 19 | brew install "git" 20 | 21 | brew install --cask "iterm2" 22 | 23 | brew install --cask "flux" 24 | 25 | brew install --cask "google-backup-and-sync" 26 | 27 | brew install "keepingyouawake" 28 | 29 | brew install --cask "rectangle" 30 | 31 | brew install "powershell" -------------------------------------------------------------------------------- /MacOS/bash_profile: -------------------------------------------------------------------------------- 1 | alias python='python3' 2 | -------------------------------------------------------------------------------- /Run-ManualBasicInstall.ps1: -------------------------------------------------------------------------------- 1 | $here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 2 | 3 | & "$Here\Install-Boxstarter.ps1" 4 | 5 | & "$Here\Install-Common.ps1" 6 | 7 | & "$Here\Install-DevTools.ps1" 8 | 9 | & "$Here\Install-VsCode.ps1" -------------------------------------------------------------------------------- /SQL-Server/Add-SqlServerAlias.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | $Alias = ".\ss2012", 3 | # Update as required. Change the port number if using a static custom port. If using a dynamic custom port, then remove the comma and port number - ,1433. 4 | $Server = "localhost\sqlexpress" 5 | ) 6 | 7 | # This script creates a 64bit and 32bit SQL Alias on the server. Run this script on all servers in your SharePoint farm. 8 | 9 | Write-Host "Creating x64 SQL Alias" 10 | 11 | New-Item -path HKLM:SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo 12 | 13 | New-ItemProperty HKLM:SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo -name $Alias -propertytype String -value "DBMSSOCN,$Server" 14 | 15 | Write-Host "Creating 32bit SQL Alias" 16 | 17 | New-Item -path HKLM:SOFTWARE\Wow6432Node\Microsoft\MSSQLServer\Client\ConnectTo 18 | 19 | Write-Host "Configured SQL Alias on the Server" 20 | 21 | New-ItemProperty HKLM:SOFTWARE\Wow6432Node\Microsoft\MSSQLServer\Client\ConnectTo -name $Alias -propertytype String -value "DBMSSOCN,$Server" 22 | -------------------------------------------------------------------------------- /SQL-Server/Install-SqlPowerShellModule.ps1: -------------------------------------------------------------------------------- 1 | Install-Module -Name SqlServer -Force -AllowClobber -------------------------------------------------------------------------------- /SQL-Server/Install-SqlServer.ps1: -------------------------------------------------------------------------------- 1 | Write-Output "Starting SQL Server Installs" 2 | 3 | # choco install sql-server-express -ia "/IACCEPTSQLSERVERLICENSETERMS /Q /ACTION=install /INSTANCEID=MSSQLSERVER /INSTANCENAME=MSSQLSERVER /UPDATEENABLED=FALSE" -o -y 4 | 5 | # Switching to SQL Server 2019 Developer Edition, which is free for all non-prod uses and doesn't limit to 10gb dbs like Express 6 | 7 | choco install sql-server-2019 8 | 9 | choco install sql-server-management-studio 10 | 11 | choco install azure-data-studio 12 | -------------------------------------------------------------------------------- /Sysprep.bat: -------------------------------------------------------------------------------- 1 | netsh advfirewall firewall set rule name="WinRM-HTTP" new action=block 2 | 3 | c:\windows\system32\sysprep\sysprep.exe /oobe /generalize /shutdown /mode:vm /unattend:a:\autounattend.xml /quiet -------------------------------------------------------------------------------- /Ubuntu/README.md: -------------------------------------------------------------------------------- 1 | Notes from Hands On 2023-03-19 2 | 3 | Install Ubuntu from USB 4 | 5 | Install Bitwarden in Firefox 6 | 7 | Follow instructions on docs.docker.com/engine/install/ubuntu 8 | 9 | This includes sudo apt-get update 10 | 11 | Restart 12 | 13 | Run `sudo docker run hello-world` to verify things are ready! 14 | 15 | git clone https://github.com/mattgwagner/dotfiles 16 | 17 | cd Portainer && docker compose up -d 18 | 19 | go to http://localhost:9000 and set admin username and password for Portainer 20 | 21 | Add stack in Portainer for Cloudflared 22 | Need to get the env variable for TOKEN from one.dash.cloudflare.com by going to Access, Tunnels 23 | Copy the token into the stack env creation 24 | -------------------------------------------------------------------------------- /Update-GitSubtree.ps1: -------------------------------------------------------------------------------- 1 | # Reference https://www.sourcefield.nl/post/git-subtree-survival-tips/ 2 | 3 | param( 4 | $Ref = "main", # branch or tag; defaults to 'master' if parameter 1 not present 5 | $Remote = "some-remote", # just a name to identify the remote 6 | $Repo = "https://github.com/actions/virtual-environments.git", # replace this with your repository URL 7 | $Folder = ".github-actions" # where to mount the subtree 8 | ) 9 | 10 | git remote add $REMOTE --no-tags $REPO 11 | 12 | if(Test-Path $Folder) # update the existing subtree 13 | { 14 | git subtree pull $REMOTE $REF --prefix=$FOLDER --squash -m "Merging '$REF' into '$FOLDER'" 15 | } 16 | else # add the subtree 17 | { 18 | git subtree add $REMOTE $REF --prefix=$FOLDER --squash -m "Merging '$REF' into '$FOLDER'" 19 | } 20 | 21 | git remote remove $REMOTE 22 | 23 | # git subtree add --prefix .github-actions https://github.com/actions/virtual-environments.git master --squash 24 | 25 | # git subtree pull --prefix .github-actions https://github.com/actions/virtual-environments.git master --squash -------------------------------------------------------------------------------- /Use-Vagrant.ps1: -------------------------------------------------------------------------------- 1 | $Box = "packer_hyperv-iso_hyperv" 2 | 3 | vagrant box add $Box .\$Box.box 4 | 5 | vagrant init $Box 6 | 7 | vagrant up -------------------------------------------------------------------------------- /Vagrantfile.multi: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | 3 | config.vm.define "rld" do |prov| 4 | prov.vm.box = "Windows-2019-20200331" 5 | 6 | prov.vm.provider "hyperv" do |vm, override| 7 | vm.auto_start_action = 'StartIfRunning' 8 | vm.auto_stop_action = 'Save' 9 | vm.maxmemory = 32896 10 | vm.memory = 8192 11 | end 12 | end 13 | 14 | config.vm.define "rld-2" do |prov| 15 | prov.vm.box = "Windows-2019-20200331" 16 | 17 | prov.vm.provider "hyperv" do |vm, override| 18 | vm.auto_start_action = 'StartIfRunning' 19 | vm.auto_stop_action = 'Save' 20 | vm.maxmemory = 32896 21 | vm.memory = 32896 22 | vm.cpus = 12 23 | end 24 | end 25 | end -------------------------------------------------------------------------------- /Vagrantfile.template: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | 3 | config.vm.guest = :windows 4 | config.vm.communicator = "winrm" 5 | 6 | config.winrm.username = "vagrant" 7 | config.winrm.password = "vagrant" 8 | 9 | config.vm.network "public_network" 10 | config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true 11 | 12 | config.vm.synced_folder "~/", "/vagrant", automount: true 13 | 14 | config.vm.provider :virtualbox do |v, override| 15 | v.gui = false 16 | v.memory = 8192 17 | v.cpus = 4 18 | v.linked_clone = true 19 | v.customize ["modifyvm", :id, "--nictype1", "82545EM"] 20 | v.customize ["modifyvm", :id, "--clipboard-mode", "disabled"] 21 | v.customize ["modifyvm", :id, "--paravirtprovider", "hyperv"] 22 | v.customize ["modifyvm", :id, "--vram", "128"] 23 | v.customize ["modifyvm", :id, "--accelerate3d", "on"] 24 | v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ] 25 | end 26 | 27 | config.vm.provider "hyperv" do |v, override| 28 | v.enable_virtualization_extensions = true 29 | v.auto_start_action = 'StartIfRunning' 30 | v.auto_stop_action = 'Save' 31 | v.memory = 8192 32 | v.cpus = 4 33 | v.linked_clone = true 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /Windows-10-Enterprise/Build.ps1: -------------------------------------------------------------------------------- 1 | $here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 2 | 3 | $Timer = [Diagnostics.Stopwatch]::StartNew() 4 | 5 | packer build --only=hyperv-iso $here\windows-10-enterprise.json 6 | 7 | $Timer.Stop() 8 | 9 | Write-Host "Hyper-V Image Built in $($Timer.Elapsed)" -------------------------------------------------------------------------------- /Windows-10-Pro/Build.ps1: -------------------------------------------------------------------------------- 1 | $here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 2 | 3 | $Timer = [Diagnostics.Stopwatch]::StartNew() 4 | 5 | packer build --only=hyperv-iso $here\windows-10-pro.json 6 | 7 | $Timer.Stop() 8 | 9 | Write-Host "Hyper-V Image Built in $($Timer.Elapsed)" -------------------------------------------------------------------------------- /Windows-2019/Build-Minimal.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [bool]$DoNotVagrantIfy = $false 3 | ) 4 | 5 | $here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 6 | 7 | $Timer = [Diagnostics.Stopwatch]::StartNew() 8 | 9 | if($DoNotVagrantIfy) 10 | { 11 | packer build --only=hyperv-iso --except vagrant-image $here\windows-2019-minimal.json 12 | } 13 | else 14 | { 15 | packer build --only=hyperv-iso $here\windows-2019-minimal.json 16 | } 17 | 18 | $Timer.Stop() 19 | 20 | Write-Host "Hyper-V Image Built in $($Timer.Elapsed)" -------------------------------------------------------------------------------- /Windows-2019/Build.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [bool]$DoNotVagrantIfy = $false 3 | ) 4 | 5 | $here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 6 | 7 | $Timer = [Diagnostics.Stopwatch]::StartNew() 8 | 9 | if($DoNotVagrantIfy) 10 | { 11 | packer build --only=hyperv-iso --except vagrant-image $here\windows-2019.json 12 | } 13 | else 14 | { 15 | packer build --only=hyperv-iso $here\windows-2019.json 16 | } 17 | 18 | $Timer.Stop() 19 | 20 | Write-Host "Hyper-V Image Built in $($Timer.Elapsed)" -------------------------------------------------------------------------------- /Windows-2022/Build.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [bool]$DoNotVagrantIfy = $false 3 | ) 4 | 5 | $here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 6 | 7 | $Timer = [Diagnostics.Stopwatch]::StartNew() 8 | 9 | if($DoNotVagrantIfy) 10 | { 11 | packer build --only=hyperv-iso --except vagrant-image $here\windows-2022.json 12 | } 13 | else 14 | { 15 | packer build --only=hyperv-iso $here\windows-2022.json 16 | } 17 | 18 | $Timer.Stop() 19 | 20 | Write-Host "Hyper-V Image Built in $($Timer.Elapsed)" --------------------------------------------------------------------------------