Skip to content
65 changes: 65 additions & 0 deletions .github/workflows/__swift-autodetect.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions pr-checks/checks/swift-autodetect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This check should be combined into `multi-language-autodetect.yml` once Swift is GA'ed
# and the `CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT` environment variable is not needed.
Copy link
Contributor

@henrymercer henrymercer Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be fine to set CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true in multi-language-autodetect.yml to help cut down on the number of jobs. We could add some checks on the tools version to make sure that language autodetection does the right thing for old CLIs too.

name: "Swift analysis with language autodetection"
description: "Tests creation of a Swift database when language is not specified in `init`"
versions: ["latest", "cached", "nightly-latest"]
# Swift autobuilder is only supported on MacOS for private beta
operatingSystems: ["macos"]
env:
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true"
steps:
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/autobuild
- uses: ./../action/analyze
id: analysis
env:
TEST_MODE: true
- name: Check database
shell: bash
run: |
SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
if [[ ! -d "$SWIFT_DB" ]]; then
echo "Did not create a database for Swift."
exit 1
fi