Skip to content
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

Add Ruby and Swift language autodetect test #1369

Merged
merged 11 commits into from
Nov 22, 2022
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

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
angelapwen marked this conversation as resolved.
Show resolved Hide resolved
- uses: ./../action/autobuild
- uses: ./../action/analyze
id: analysis
env:
TEST_MODE: true
angelapwen marked this conversation as resolved.
Show resolved Hide resolved
- 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