-
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
Fix Swift PR Checks on nightly-latest
CLI
#1696
Changes from all commits
ebb84c5
0df283c
f2bad39
424b55e
91268d3
3ee1898
25fbb22
27af7f7
4418543
f83f109
8564eab
4b96e7b
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: "Set up Swift" | ||
description: Sets up an appropriate Swift version if Swift is enabled via CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT. | ||
description: Sets up an appropriate Swift version if supported on this platform. | ||
inputs: | ||
codeql-path: | ||
description: Path to the CodeQL CLI executable. | ||
|
@@ -9,24 +9,29 @@ runs: | |
steps: | ||
- name: Get Swift version | ||
id: get_swift_version | ||
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' | ||
if: runner.os != 'Windows' | ||
shell: bash | ||
env: | ||
CODEQL_PATH: ${{ inputs.codeql-path }} | ||
run: | | ||
if [ $RUNNER_OS = "macOS" ]; then | ||
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" | ||
if [ $SWIFT_EXTRACTOR_DIR = "null" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not critical here, but for the future we should quote variables to prevent problems with word splitting. |
||
VERSION="null" | ||
else | ||
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 | ||
fi | ||
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT | ||
|
||
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test. | ||
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' | ||
if: runner.os != 'Windows' && steps.get_swift_version.outputs.version != 'null' | ||
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.
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.
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.
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.
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.
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.
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.
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,11 +49,16 @@ jobs: | |
with: | ||
go-version: ^1.13.1 | ||
- uses: ./../action/init | ||
id: init | ||
with: | ||
tools: ${{ steps.prepare-test.outputs.tools-url }} | ||
debug: true | ||
debug-artifact-name: my-debug-artifacts | ||
debug-database-name: my-db | ||
- uses: ./../action/.github/actions/setup-swift | ||
if: matrix.version == 'nightly-latest' | ||
with: | ||
codeql-path: ${{ steps.init.outputs.codeql-path }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, I think we just need to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah... I was wondering what the failure was coming from. Thanks. |
||
- name: Build code | ||
shell: bash | ||
run: ./build.sh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,9 @@ steps: | |
fi | ||
|
||
- name: Check language autodetect for Swift | ||
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' | ||
if: >- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good, but I'm slightly surprised to see us using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes, I noticed this as well. I wonder if it's because we had previously set the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR at #1699 |
||
env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' || | ||
(runner.os != 'Windows' && matrix.version == 'nightly-latest') | ||
shell: bash | ||
run: | | ||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} | ||
|
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.
Nit: we should probably pick one of (single brace, double brace) and (single equals, double equals) and run with it. I think for our purposes here they will behave the same though.
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.
I agree! I actually changed it to double brace here to match the other instances of
$RUNNER_OS
.I think the bash I've seen so far in the workflow uses single equals for equality, but the Actions syntax outside of the bash scripts use double equals. That's what I've been following at least 😅