Merge remote-tracking branch 'upstream/main' into v-danurg/vsmac_latest_implementation

This commit is contained in:
Darii Nurgaleev
2020-09-25 19:15:46 +07:00
14 changed files with 124 additions and 4 deletions

View File

@@ -77,6 +77,7 @@ $toolsList = @(
(Get-AzCopy10Version),
(Get-BazelVersion),
(Get-BazeliskVersion),
(Get-CodeQLBundleVersion),
(Get-CMakeVersion),
(Get-CurlVersion),
(Get-DockerMobyVersion),
@@ -102,6 +103,9 @@ $toolsList = @(
(Get-NvmVersion),
(Get-PackerVersion),
(Get-PhantomJSVersion),
(Get-PulumiVersion),
(Get-RVersion),
(Get-SphinxVersion),
(Get-SwigVersion),
(Get-TerraformVersion),
(Get-UnZipVersion),

View File

@@ -28,6 +28,14 @@ function Get-BazeliskVersion {
return "Bazelisk $bazeliskVersion"
}
function Get-CodeQLBundleVersion {
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "*"
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
$CodeQLVersion = & $CodeQLPath version --quiet
return "CodeQL Action Bundle $CodeQLVersion"
}
function Get-PodManVersion {
$podmanVersion = podman --version | Take-OutputPart -Part 2
return "Podman $podmanVersion"
@@ -247,3 +255,18 @@ function Get-ORASCliVersion {
function Get-VerselCliversion {
return "$(vercel --version 2>&1 | Select-Object -First 1)"
}
function Get-PulumiVersion {
$pulumiVersion = pulumi version | Take-OutputPart -Part 0 -Delimiter "v"
return "Pulumi $pulumiVersion"
}
function Get-RVersion {
$rVersion = (Get-CommandResult "R --version | grep 'R version'").Output | Take-OutputPart -Part 2
return "R $rVersion"
}
function Get-SphinxVersion {
$sphinxVersion = searchd -h | Select-Object -First 1 | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
return "Sphinx Open Source Search Server $sphinxVersion"
}

View File

@@ -0,0 +1,28 @@
#!/bin/bash
################################################################################
## File: codeql-bundle.sh
## Desc: Install the CodeQL CLI Bundle to the toolcache.
################################################################################
source $HELPER_SCRIPTS/install.sh
# Retrieve the name of the CodeQL bundle preferred by the Action (in the format codeql-bundle-YYYYMMDD).
codeql_bundle_name="$(curl -sSL https://raw.githubusercontent.com/github/codeql-action/main/src/defaults.json | jq -r .bundleVersion)"
# Convert the bundle name to a version number (0.0.0-YYYYMMDD).
codeql_bundle_version="0.0.0-${codeql_bundle_name##*-}"
extraction_directory="$AGENT_TOOLSDIRECTORY/CodeQL/$codeql_bundle_version/x64"
mkdir -p "$extraction_directory"
echo "Downloading CodeQL bundle $codeql_bundle_version..."
download_with_retries "https://github.com/github/codeql-action/releases/download/$codeql_bundle_name/codeql-bundle.tar.gz" "/tmp" "codeql-bundle.tar.gz"
tar -xzf "/tmp/codeql-bundle.tar.gz" -C "$extraction_directory"
# Touch a special file that indicates to the CodeQL Action that this bundle was baked-in to the hosted runner images.
touch "$extraction_directory/pinned-version"
# Touch a file to indicate to the toolcache that setting up CodeQL is complete.
touch "$extraction_directory.complete"
# Test that the tool has been extracted successfully.
"$AGENT_TOOLSDIRECTORY/CodeQL/$codeql_bundle_version/x64/codeql/codeql" version

View File

@@ -150,6 +150,7 @@
"{{template_dir}}/scripts/installers/clang.sh",
"{{template_dir}}/scripts/installers/swift.sh",
"{{template_dir}}/scripts/installers/cmake.sh",
"{{template_dir}}/scripts/installers/codeql-bundle.sh",
"{{template_dir}}/scripts/installers/docker-compose.sh",
"{{template_dir}}/scripts/installers/docker-moby.sh",
"{{template_dir}}/scripts/installers/dotnetcore-sdk.sh",

View File

@@ -152,6 +152,7 @@
"{{template_dir}}/scripts/installers/clang.sh",
"{{template_dir}}/scripts/installers/swift.sh",
"{{template_dir}}/scripts/installers/cmake.sh",
"{{template_dir}}/scripts/installers/codeql-bundle.sh",
"{{template_dir}}/scripts/installers/containers.sh",
"{{template_dir}}/scripts/installers/docker-compose.sh",
"{{template_dir}}/scripts/installers/docker-moby.sh",

View File

@@ -154,6 +154,7 @@
"{{template_dir}}/scripts/installers/clang.sh",
"{{template_dir}}/scripts/installers/swift.sh",
"{{template_dir}}/scripts/installers/cmake.sh",
"{{template_dir}}/scripts/installers/codeql-bundle.sh",
"{{template_dir}}/scripts/installers/containers.sh",
"{{template_dir}}/scripts/installers/docker-compose.sh",
"{{template_dir}}/scripts/installers/docker-moby.sh",

View File

@@ -11,7 +11,7 @@
"6.12.0.93", "6.10.0.106", "6.8.0.123", "6.6.0.166", "6.4.0.208"
],
"ios-versions": [
"13.20.2.2", "13.18.2.1", "13.16.0.13", "13.14.1.39", "13.10.0.21", "13.8.3.0", "13.6.0.12", "13.4.0.2", "13.2.0.47"
"14.0.0.0", "13.20.2.2", "13.18.2.1", "13.16.0.13", "13.14.1.39", "13.10.0.21", "13.8.3.0", "13.6.0.12", "13.4.0.2", "13.2.0.47"
],
"mac-versions": [
"6.20.2.2", "6.18.3.2", "6.16.0.13", "6.14.1.39", "6.10.0.21", "6.8.3.0", "6.6.0.12", "6.4.0.2", "6.2.0.47"
@@ -21,6 +21,13 @@
],
"bundle-default": "latest",
"bundles": [
{
"symlink": "6_12_1",
"mono":"6.12",
"ios": "14.0",
"mac": "6.20",
"android": "11.0"
},
{
"symlink": "6_12_0",
"mono":"6.12",

View File

@@ -11,7 +11,7 @@
"6.12.0.93"
],
"ios-versions": [
"13.20.2.2"
"14.0.0.0", "13.20.2.2"
],
"mac-versions": [
"6.20.2.2"
@@ -21,6 +21,13 @@
],
"bundle-default": "latest",
"bundles": [
{
"symlink": "6_12_1",
"mono":"6.12",
"ios": "14.0",
"mac": "6.20",
"android": "11.0"
},
{
"symlink": "6_12_0",
"mono":"6.12",

View File

@@ -320,7 +320,8 @@
"{{ template_dir }}/scripts/Installers/Install-KubernetesCli.ps1",
"{{ template_dir }}/scripts/Installers/Install-Kind.ps1",
"{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1",
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1"
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1",
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1"
]
},
{

View File

@@ -318,7 +318,8 @@
"{{ template_dir }}/scripts/Installers/Install-AliyunCli.ps1",
"{{ template_dir }}/scripts/Installers/Install-RootCA.ps1",
"{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1",
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1"
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1",
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1"
]
},
{

View File

@@ -0,0 +1,28 @@
################################################################################
## File: Install-CodeQLBundle.ps1
## Desc: Install the CodeQL CLI Bundle to the toolcache.
################################################################################
# Retrieve the name of the CodeQL bundle preferred by the Action (in the format codeql-bundle-YYYYMMDD).
$CodeQLBundleName = (Invoke-RestMethod "https://raw.githubusercontent.com/github/codeql-action/main/src/defaults.json").bundleVersion
# Convert the bundle name to a version number (0.0.0-YYYYMMDD).
$CodeQLBundleVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
$ExtractionDirectory = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath $CodeQLBundleVersion | Join-Path -ChildPath "x64"
New-Item -Path $ExtractionDirectory -ItemType Directory -Force | Out-Null
Write-Host "Downloading CodeQL bundle $CodeQLBundleVersion..."
$CodeQLBundlePath = Start-DownloadWithRetry -Url "https://github.com/github/codeql-action/releases/download/$CodeQLBundleName/codeql-bundle.tar.gz" -Name "codeql-bundle.tar.gz"
$DownloadDirectoryPath = (Get-Item $CodeQLBundlePath).Directory.FullName
Extract-7Zip -Path $CodeQLBundlePath -DestinationPath $DownloadDirectoryPath
$UnGzipedCodeQLBundlePath = Join-Path $DownloadDirectoryPath "codeql-bundle.tar"
Extract-7Zip -Path $UnGzipedCodeQLBundlePath -DestinationPath $ExtractionDirectory
# Touch a special file that indicates to the CodeQL Action that this bundle was baked-in to the hosted runner images.
New-Item -ItemType file (Join-Path $ExtractionDirectory -ChildPath "pinned-version")
# Touch a file to indicate to the toolcache that setting up CodeQL is complete.
New-Item -ItemType file "$ExtractionDirectory.complete"
# Test that the tool has been extracted successfully.
Invoke-PesterTests -TestFile "Tools" -TestName "CodeQLBundle"

View File

@@ -77,6 +77,7 @@ $markdown += New-MDList -Style Unordered -Lines @(
(Get-BazelVersion),
(Get-BazeliskVersion),
(Get-CMakeVersion),
(Get-CodeQLBundleVersion),
(Get-RVersion),
(Get-DockerVersion),
(Get-DockerComposeVersion),

View File

@@ -30,6 +30,14 @@ function Get-CMakeVersion {
return "CMake $cmakeVersion"
}
function Get-CodeQLBundleVersion {
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "*"
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
$CodeQLVersion = $($CodeQLPath version --quiet)
return "CodeQL Action Bundle $CodeQLVersion"
}
function Get-DockerVersion {
$dockerVersion = $(docker version --format "{{.Server.Version}}")
return "Docker $dockerVersion"

View File

@@ -41,6 +41,15 @@ Describe "CMake" {
}
}
Describe "CodeQLBundle" {
It "CodeQLBundle" {
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "*"
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
"$CodeQLPath version" | Should -ReturnZeroExitCode
}
}
Describe "R" {
It "Rscript" {
"Rscript --version" | Should -ReturnZeroExitCode