Skip to content

Commit a44b61d

Browse files
Merge pull request #707 from edoardopirovano/cli-version
Improve handling of CLI versions
2 parents 50de2e4 + a062fc9 commit a44b61d

22 files changed

+172
-74
lines changed

.github/workflows/pr-checks.yml

+21-5
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ jobs:
292292
outputs:
293293
versions: ${{ steps.compare.outputs.versions }}
294294
nightly-url: ${{ steps.get-url.outputs.nightly-url }}
295-
295+
env:
296+
# URL of the oldest release that we support, if this is being bumped then the constant
297+
# CODEQL_MINIMUM_VERSION in the file codeql.ts should also be bumped to match this.
298+
OLDEST_URL: https://github.com/github/codeql-action/releases/download/codeql-bundle-20201028/codeql-bundle.tar.gz
296299
steps:
297300
- uses: actions/checkout@v2
298301
- name: Move codeql-action
@@ -336,31 +339,44 @@ jobs:
336339
with:
337340
tools: ${{ steps.get-url.outputs.nightly-url }}
338341
languages: javascript
342+
- name: Remove empty database
343+
# allows us to run init a fourth time
344+
run: |
345+
rm -rf "$RUNNER_TEMP/codeql_databases"
346+
- name: Init with a CodeQL bundle from the oldest supported release
347+
id: init-oldest
348+
uses: ./../action/init
349+
with:
350+
tools: ${{ env.OLDEST_URL }}
351+
languages: javascript
339352
- name: Compare CodeQL bundle versions
340353
id: compare
341354
env:
342355
CODEQL_DEFAULT: ${{ steps.init-default.outputs.codeql-path }}
343356
CODEQL_LATEST: ${{ steps.init-latest.outputs.codeql-path }}
344357
CODEQL_NIGHTLY: ${{ steps.init-nightly.outputs.codeql-path }}
358+
CODEQL_OLDEST: ${{ steps.init-oldest.outputs.codeql-path }}
345359
NIGHTLY_URL: ${{ steps.get-url.outputs.nightly-url }}
346360
run: |
347361
CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)"
348362
CODEQL_VERSION_LATEST="$("$CODEQL_LATEST" version --format terse)"
349363
CODEQL_VERSION_NIGHTLY="$("$CODEQL_NIGHTLY" version --format terse)"
364+
CODEQL_VERSION_OLDEST="$("$CODEQL_OLDEST" version --format terse)"
350365
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
351366
echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST"
352367
echo "Nightly CodeQL bundle version is $CODEQL_VERSION_NIGHTLY"
368+
echo "Oldest supported CodeQL bundle version is $CODEQL_VERSION_OLDEST"
353369
354-
# If we're running on a pull request, run each integration test with all three bundles, even
370+
# If we're running on a pull request, run each integration test with all four bundles, even
355371
# if `tools: latest` would be the same as `tools: null`. This allows us to make the
356-
# integration test job for each of the three bundles a required status check.
372+
# integration test job for each of the four bundles a required status check.
357373
#
358374
# If we're running on push, then we can skip running with `tools: latest` when it would be
359375
# the same as running with `tools: null`.
360376
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
361-
VERSIONS_JSON="[null, \"$NIGHTLY_URL\"]"
377+
VERSIONS_JSON="[null, \"$NIGHTLY_URL\", \"$OLDEST_URL\"]"
362378
else
363-
VERSIONS_JSON="[null, \"$NIGHTLY_URL\", \"latest\"]"
379+
VERSIONS_JSON="[null, \"$NIGHTLY_URL\", \"$OLDEST_URL\", \"latest\"]"
364380
fi
365381
366382
# Output a JSON-encoded list with the distinct versions to test against.

lib/analyze.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js

+41-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)