Ensure cli using latest version from the supported_cli_versions.json (#1992)

This commit is contained in:
Taj 2023-01-20 17:13:14 +00:00 коммит произвёл GitHub
Родитель a17e41cbf1
Коммит c7f72c5aa9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 10 добавлений и 17 удалений

6
.github/workflows/bump-cli.yml поставляемый
Просмотреть файл

@ -45,10 +45,10 @@ jobs:
- name: Prepend another version
if: ${{ inputs.option == 'prepend' }}
run: |
cat supported_cli_versions.json | jq '. |= ["${{ inputs.version }}"] + .' > supported_cli_versions_temp.json
mv supported_cli_versions_temp.json supported_cli_versions.json
cat extensions/ql-vscode/supported_cli_versions.json | jq '. |= ["${{ inputs.version }}"] + .' > supported_cli_versions_temp.json
mv supported_cli_versions_temp.json extensions/ql-vscode/supported_cli_versions.json
echo "LATEST_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
echo "PREVIOUS_VERSION=`jq -r '.[1]' supported_cli_versions.json`" >> $GITHUB_ENV
echo "PREVIOUS_VERSION=`jq -r '.[1]' extensions/ql-vscode/supported_cli_versions.json`" >> $GITHUB_ENV
- name: Commit, Push and Open a PR
uses: ./.github/actions/create-pr
with:

2
.github/workflows/main.yml поставляемый
Просмотреть файл

@ -191,7 +191,7 @@ jobs:
uses: actions/checkout@v3
- name: Set the variables
id: set-variables
run: echo "cli-versions=$(cat ./supported_cli_versions.json | jq -rc)" >> $GITHUB_OUTPUT
run: echo "cli-versions=$(cat ./extensions/ql-vscode/supported_cli_versions.json | jq -rc)" >> $GITHUB_OUTPUT
outputs:
cli-versions: ${{ steps.set-variables.outputs.cli-versions }}
cli-test:

Просмотреть файл

@ -0,0 +1 @@
["v2.11.6", "v2.7.6", "v2.8.5", "v2.9.4", "v2.10.5", "nightly"]

Просмотреть файл

@ -6,6 +6,7 @@ import {
codeQlLauncherName,
} from "../../src/pure/distribution";
import fetch from "node-fetch";
import supportedCliVersions from "../../supported_cli_versions.json";
/**
* This module ensures that the proper CLI is available for tests of the extension.
@ -36,9 +37,9 @@ import fetch from "node-fetch";
const _1MB = 1024 * 1024;
const _10MB = _1MB * 10;
// CLI version to test. Hard code the latest as default. And be sure
// to update the env if it is not otherwise set.
const CLI_VERSION = process.env.CLI_VERSION || "v2.11.6";
// CLI version to test. Use the latest supported version by default.
// And be sure to update the env if it is not otherwise set.
const CLI_VERSION = process.env.CLI_VERSION || supportedCliVersions[0];
process.env.CLI_VERSION = CLI_VERSION;
// Base dir where CLIs will be downloaded into

Просмотреть файл

@ -9,5 +9,4 @@ PREVIOUS_VERSION=$(echo $VERSIONS | awk '{ print $2 }')
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV
sed -i "s/$PREVIOUS_VERSION/$LATEST_VERSION/g" supported_cli_versions.json
sed -i "s/$PREVIOUS_VERSION/$LATEST_VERSION/g" extensions/ql-vscode/test/vscode-tests/ensureCli.ts
sed -i "s/$PREVIOUS_VERSION/$LATEST_VERSION/g" extensions/ql-vscode/supported_cli_versions.json

Просмотреть файл

@ -1,8 +0,0 @@
[
"v2.11.6",
"v2.7.6",
"v2.8.5",
"v2.9.4",
"v2.10.5",
"nightly"
]