Skip to content

Commit 8c923c0

Browse files
authored
Fix Swift PR Checks on nightly-latest CLI (#1696)
1 parent 1245696 commit 8c923c0

34 files changed

+55
-72
lines changed
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "Set up Swift"
2-
description: Sets up an appropriate Swift version if Swift is enabled via CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT.
2+
description: Sets up an appropriate Swift version if supported on this platform.
33
inputs:
44
codeql-path:
55
description: Path to the CodeQL CLI executable.
@@ -9,24 +9,29 @@ runs:
99
steps:
1010
- name: Get Swift version
1111
id: get_swift_version
12-
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
12+
if: runner.os != 'Windows'
1313
shell: bash
1414
env:
1515
CODEQL_PATH: ${{ inputs.codeql-path }}
1616
run: |
17-
if [ $RUNNER_OS = "macOS" ]; then
17+
if [[ $RUNNER_OS = "macOS" ]]; then
1818
PLATFORM="osx64"
1919
else # We do not run this step on Windows.
2020
PLATFORM="linux64"
2121
fi
2222
SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')"
23-
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')"
24-
# Specify 5.7.0, otherwise setup Action will default to latest minor version.
25-
if [ $VERSION = "5.7" ]; then
26-
VERSION="5.7.0"
23+
if [ $SWIFT_EXTRACTOR_DIR = "null" ]; then
24+
VERSION="null"
25+
else
26+
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')"
27+
# Specify 5.7.0, otherwise setup Action will default to latest minor version.
28+
if [ $VERSION = "5.7" ]; then
29+
VERSION="5.7.0"
30+
fi
2731
fi
2832
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
33+
2934
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
30-
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
35+
if: runner.os != 'Windows' && steps.get_swift_version.outputs.version != 'null'
3136
with:
3237
swift-version: "${{ steps.get_swift_version.outputs.version }}"

.github/workflows/__analyze-ref-input.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__autobuild-action.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__config-export.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__diagnostics-export.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__export-file-baseline-information.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__extractor-ram-threads.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-queries.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-tracing-autobuilder.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-tracing-custom-build-steps.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-tracing-legacy-workflow.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__init-with-registries.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__javascript-source-root.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__ml-powered-queries.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__multi-language-autodetect.yml

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__packaging-codescanning-config-inputs-js.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__packaging-config-inputs-js.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__packaging-config-js.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__packaging-inputs-js.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__remote-config.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__rubocop-multi-language.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__ruby.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__split-workflow.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__submit-sarif-failure.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__swift-custom-build.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__test-autobuild-working-dir.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__test-local-codeql.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__test-proxy.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__unset-environment.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__upload-ref-sha-input.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__with-checkout-path.yml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/debug-artifacts.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,16 @@ jobs:
4949
with:
5050
go-version: ^1.13.1
5151
- uses: ./../action/init
52+
id: init
5253
with:
5354
tools: ${{ steps.prepare-test.outputs.tools-url }}
5455
debug: true
5556
debug-artifact-name: my-debug-artifacts
5657
debug-database-name: my-db
58+
- uses: ./../action/.github/actions/setup-swift
59+
if: matrix.version == 'nightly-latest'
60+
with:
61+
codeql-path: ${{ steps.init.outputs.codeql-path }}
5762
- name: Build code
5863
shell: bash
5964
run: ./build.sh

pr-checks/checks/multi-language-autodetect.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ steps:
6666
fi
6767
6868
- name: Check language autodetect for Swift
69-
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
69+
if: >-
70+
env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' ||
71+
(runner.os != 'Windows' && matrix.version == 'nightly-latest')
7072
shell: bash
7173
run: |
7274
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}

pr-checks/sync.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ def writeHeader(checkStream):
8383
matrix.version == '20220908' ||
8484
matrix.version == '20221211' ||
8585
matrix.version == 'cached' ||
86-
matrix.version == 'latest' ||
87-
matrix.version == 'nightly-latest'
86+
matrix.version == 'latest'
8887
)
8988
''').strip()),
9089
'shell': 'bash',

0 commit comments

Comments
 (0)