From fcf7c47f2f411ffb2cab9cefb0988c11847db9c1 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Fri, 13 Oct 2023 13:05:10 -0700 Subject: [PATCH] Explicitly setup a kotlin version Change the `prepare-test` action to conditionally setup kotlin. --- .github/actions/prepare-test/action.yml | 9 +++++++++ .github/workflows/__all-platform-bundle.yml | 1 + .github/workflows/__analyze-ref-input.yml | 1 + .github/workflows/__autobuild-action.yml | 1 + .github/workflows/__config-export.yml | 1 + .github/workflows/__diagnostics-export.yml | 1 + .github/workflows/__export-file-baseline-information.yml | 1 + .github/workflows/__extractor-ram-threads.yml | 1 + .github/workflows/__go-custom-queries.yml | 1 + .../__go-indirect-tracing-workaround-diagnostic.yml | 1 + .github/workflows/__go-indirect-tracing-workaround.yml | 1 + .github/workflows/__go-tracing-autobuilder.yml | 1 + .github/workflows/__go-tracing-custom-build-steps.yml | 1 + .github/workflows/__go-tracing-legacy-workflow.yml | 1 + .github/workflows/__init-with-registries.yml | 1 + .github/workflows/__javascript-source-root.yml | 1 + .github/workflows/__language-aliases.yml | 1 + .github/workflows/__multi-language-autodetect.yml | 1 + .../__packaging-codescanning-config-inputs-js.yml | 4 +++- .github/workflows/__packaging-config-inputs-js.yml | 4 +++- .github/workflows/__packaging-config-js.yml | 4 +++- .github/workflows/__packaging-inputs-js.yml | 4 +++- .github/workflows/__remote-config.yml | 1 + .github/workflows/__resolve-environment-action.yml | 4 +++- .github/workflows/__rubocop-multi-language.yml | 1 + .github/workflows/__ruby.yml | 1 + .github/workflows/__scaling-reserved-ram.yml | 1 + .github/workflows/__split-workflow.yml | 1 + .github/workflows/__submit-sarif-failure.yml | 1 + .github/workflows/__swift-custom-build.yml | 1 + .github/workflows/__test-autobuild-working-dir.yml | 1 + .github/workflows/__test-local-codeql.yml | 1 + .github/workflows/__test-proxy.yml | 1 + .github/workflows/__unset-environment.yml | 1 + .github/workflows/__upload-ref-sha-input.yml | 1 + .github/workflows/__with-checkout-path.yml | 1 + pr-checks/sync.py | 5 ++++- 37 files changed, 58 insertions(+), 6 deletions(-) diff --git a/.github/actions/prepare-test/action.yml b/.github/actions/prepare-test/action.yml index 2cbe4626e..8f1b7793b 100644 --- a/.github/actions/prepare-test/action.yml +++ b/.github/actions/prepare-test/action.yml @@ -8,6 +8,10 @@ inputs: description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL" default: 'false' required: false + setup-kotlin: + description: "If true, we setup kotlin" + default: 'true' + required: true outputs: tools-url: description: "The value that should be passed as the 'tools' input of the 'init' step." @@ -58,3 +62,8 @@ runs: echo "::error::Unrecognized version specified!" exit 1 fi + + - uses: fwilhe2/setup-kotlin@fa932efcc943c56bfd69ddace2e61129eb495d58 + if: ${{ inputs.setup-kotlin }} == "true" + with: + version: 1.7.21 diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 6dffe6317..4db3d552e 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'true' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index 9ebc17e57..f056a0cce 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -45,6 +45,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml index 3c7fc7584..4b77b741e 100644 --- a/.github/workflows/__autobuild-action.yml +++ b/.github/workflows/__autobuild-action.yml @@ -45,6 +45,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__config-export.yml b/.github/workflows/__config-export.yml index c93249327..033cd4ce7 100644 --- a/.github/workflows/__config-export.yml +++ b/.github/workflows/__config-export.yml @@ -51,6 +51,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__diagnostics-export.yml b/.github/workflows/__diagnostics-export.yml index 61dfe905d..74e06a27f 100644 --- a/.github/workflows/__diagnostics-export.yml +++ b/.github/workflows/__diagnostics-export.yml @@ -57,6 +57,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index e6c680f4b..e527265d3 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -45,6 +45,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__extractor-ram-threads.yml b/.github/workflows/__extractor-ram-threads.yml index 8a6b737f2..13d10f5d2 100644 --- a/.github/workflows/__extractor-ram-threads.yml +++ b/.github/workflows/__extractor-ram-threads.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index b31012eaa..94b6f3f0e 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -87,6 +87,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml index 51405e38c..8302a0286 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index 26ff116b3..ef68096ca 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index 92035638a..552fb13f6 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -71,6 +71,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index cdf949345..1389cfc74 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -71,6 +71,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index df1b8959e..b3c4cbd8b 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -71,6 +71,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__init-with-registries.yml b/.github/workflows/__init-with-registries.yml index accd60d40..b8834a82b 100644 --- a/.github/workflows/__init-with-registries.yml +++ b/.github/workflows/__init-with-registries.yml @@ -58,6 +58,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__javascript-source-root.yml b/.github/workflows/__javascript-source-root.yml index 427313964..c8b6308e6 100644 --- a/.github/workflows/__javascript-source-root.yml +++ b/.github/workflows/__javascript-source-root.yml @@ -45,6 +45,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__language-aliases.yml b/.github/workflows/__language-aliases.yml index c6a2c7bd0..39223be8d 100644 --- a/.github/workflows/__language-aliases.yml +++ b/.github/workflows/__language-aliases.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index ecd054e32..427f47362 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -71,6 +71,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index 259fcc70b..b3089db60 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -57,6 +57,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( @@ -83,7 +84,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index e982f8483..b70a35e05 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -57,6 +57,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( @@ -83,7 +84,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index ad8f4dc90..c1cd61486 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -57,6 +57,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( @@ -82,7 +83,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index bce0f5b1d..2fa5e0c8d 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -57,6 +57,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( @@ -82,7 +83,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml index 05ff8f593..47fc30f10 100644 --- a/.github/workflows/__remote-config.yml +++ b/.github/workflows/__remote-config.yml @@ -87,6 +87,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__resolve-environment-action.yml b/.github/workflows/__resolve-environment-action.yml index eeada6c54..8ff6de3b5 100644 --- a/.github/workflows/__resolve-environment-action.yml +++ b/.github/workflows/__resolve-environment-action.yml @@ -63,6 +63,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( @@ -95,7 +96,8 @@ jobs: language: javascript-typescript - name: Fail if JavaScript/TypeScript configuration present - if: matrix.version != 'stable-v2.13.4' && fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript + if: matrix.version != 'stable-v2.13.4' && + fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript run: exit 1 env: CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml index faa2b9ab3..d2d3b11a7 100644 --- a/.github/workflows/__rubocop-multi-language.yml +++ b/.github/workflows/__rubocop-multi-language.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__ruby.yml b/.github/workflows/__ruby.yml index 5747471e4..e3cec33dd 100644 --- a/.github/workflows/__ruby.yml +++ b/.github/workflows/__ruby.yml @@ -51,6 +51,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__scaling-reserved-ram.yml b/.github/workflows/__scaling-reserved-ram.yml index 728002871..fb1011691 100644 --- a/.github/workflows/__scaling-reserved-ram.yml +++ b/.github/workflows/__scaling-reserved-ram.yml @@ -71,6 +71,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml index 3257e82cc..620947c29 100644 --- a/.github/workflows/__split-workflow.yml +++ b/.github/workflows/__split-workflow.yml @@ -51,6 +51,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__submit-sarif-failure.yml b/.github/workflows/__submit-sarif-failure.yml index 61f9ab2a9..7da2e7b00 100644 --- a/.github/workflows/__submit-sarif-failure.yml +++ b/.github/workflows/__submit-sarif-failure.yml @@ -45,6 +45,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 86447796d..bc60cdaa6 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -51,6 +51,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__test-autobuild-working-dir.yml b/.github/workflows/__test-autobuild-working-dir.yml index dabd3bd25..3998431d5 100644 --- a/.github/workflows/__test-autobuild-working-dir.yml +++ b/.github/workflows/__test-autobuild-working-dir.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__test-local-codeql.yml b/.github/workflows/__test-local-codeql.yml index efb3161a4..e46d7f59e 100644 --- a/.github/workflows/__test-local-codeql.yml +++ b/.github/workflows/__test-local-codeql.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__test-proxy.yml b/.github/workflows/__test-proxy.yml index bc1827d1f..5bb2a85e4 100644 --- a/.github/workflows/__test-proxy.yml +++ b/.github/workflows/__test-proxy.yml @@ -41,6 +41,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: false - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml index bb48fe9a1..5c89187e6 100644 --- a/.github/workflows/__unset-environment.yml +++ b/.github/workflows/__unset-environment.yml @@ -55,6 +55,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index 4ceb13c02..15404001e 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -45,6 +45,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 5a4aa00f9..4f0e1c30f 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -87,6 +87,7 @@ jobs: with: version: ${{ matrix.version }} use-all-platform-bundle: 'false' + setup-kotlin: true - name: Set environment variable for Swift enablement if: >- runner.os != 'Windows' && ( diff --git a/pr-checks/sync.py b/pr-checks/sync.py index d57d94a7f..300395250 100644 --- a/pr-checks/sync.py +++ b/pr-checks/sync.py @@ -80,7 +80,10 @@ def writeHeader(checkStream): 'uses': './.github/actions/prepare-test', 'with': { 'version': '${{ matrix.version }}', - 'use-all-platform-bundle': useAllPlatformBundle + 'use-all-platform-bundle': useAllPlatformBundle, + # If the action is being run from a container, then do not setup kotlin. + # This is because the kotlin binaries cannot be downloaded from the container. + 'setup-kotlin': not 'container' in checkSpecification, } }, # We don't support Swift on Windows or prior versions of the CLI.