-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up the Swift version the extractor declares #1422
Changes from all commits
2474e31
4d8bc9a
50fd9ed
31aec7e
20b2d99
bf7b57a
f98790d
ae01aeb
bf101af
8abe7d8
f57b19c
b72cfb6
4efa340
c50429d
e605467
8b813b9
3dcfa89
eeabe6a
b44d043
bfbd05f
609cafe
e49ccec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: "Set up Swift" | ||
description: Performs necessary steps to set up appropriate Swift version. | ||
inputs: | ||
codeql-path: | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get Swift version | ||
id: get_swift_version | ||
# We don't support Swift on Windows or prior versions of CLI. | ||
if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" | ||
shell: bash | ||
env: | ||
CODEQL_PATH: ${{inputs.codeql-path}} | ||
run: | | ||
if [ $RUNNER_OS = "macOS" ]; then | ||
PLATFORM="osx64" | ||
else # We do not run this step on Windows. | ||
PLATFORM="linux64" | ||
fi | ||
SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')" | ||
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')" | ||
# Specify 5.7.0, otherwise setup Action will default to latest minor version. | ||
if [ $VERSION = "5.7" ]; then | ||
VERSION="5.7.0" | ||
fi | ||
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT | ||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 | ||
if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" | ||
with: | ||
swift-version: "${{steps.get_swift_version.outputs.version}}" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop the Windows check here because we haven't put any Windows versions in the matrix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes — but I've actually added it back in the composite action as that might be run from a Windows workflow!