Set up the Swift version the extractor declares (#1422)
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
This commit is contained in:
parent
0a3f985290
commit
4778dfbd93
9 changed files with 97 additions and 57 deletions
32
.github/setup-swift/action.yml
vendored
Normal file
32
.github/setup-swift/action.yml
vendored
Normal file
|
|
@ -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}}"
|
||||||
12
.github/workflows/__export-file-baseline-information.yml
generated
vendored
12
.github/workflows/__export-file-baseline-information.yml
generated
vendored
|
|
@ -42,18 +42,16 @@ jobs:
|
||||||
uses: ./.github/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Windows doesn't support Swift, and only macOS latest and nightly-latest support Swift 5.7.1.
|
|
||||||
if: runner.os == 'Linux' || (runner.os == 'macOS' && matrix.version == 'cached')
|
|
||||||
with:
|
|
||||||
swift-version: 5.7.0
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
env:
|
env:
|
||||||
CODEQL_FILE_BASELINE_INFORMATION: true
|
CODEQL_FILE_BASELINE_INFORMATION: true
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
@ -62,7 +60,6 @@ jobs:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
env:
|
env:
|
||||||
CODEQL_FILE_BASELINE_INFORMATION: true
|
CODEQL_FILE_BASELINE_INFORMATION: true
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true
|
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -87,4 +84,5 @@ jobs:
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true # Remove when Swift is GA.
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|
|
||||||
19
.github/workflows/__multi-language-autodetect.yml
generated
vendored
19
.github/workflows/__multi-language-autodetect.yml
generated
vendored
|
|
@ -45,6 +45,10 @@ jobs:
|
||||||
version: latest
|
version: latest
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: latest
|
version: latest
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
|
- os: macos-latest
|
||||||
|
version: nightly-latest
|
||||||
name: Multi-language repository
|
name: Multi-language repository
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
@ -61,17 +65,16 @@ jobs:
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: ^1.13.1
|
go-version: ^1.13.1
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: 5.7.0
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
@ -125,8 +128,8 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check language autodetect for Swift
|
- name: Check language autodetect for Swift
|
||||||
if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version\
|
if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version
|
||||||
\ == 'latest' || matrix.version == 'nightly-latest')"
|
== 'nightly-latest')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
||||||
|
|
|
||||||
14
.github/workflows/__swift-autobuild.yml
generated
vendored
14
.github/workflows/__swift-autobuild.yml
generated
vendored
|
|
@ -42,15 +42,17 @@ jobs:
|
||||||
uses: ./.github/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: 5.7.0
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: swift
|
languages: swift
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
- name: Check working directory
|
||||||
|
shell: bash
|
||||||
|
run: pwd
|
||||||
- uses: ./../action/autobuild
|
- uses: ./../action/autobuild
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
|
|
@ -63,5 +65,5 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true'
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA.
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|
|
||||||
18
.github/workflows/__swift-custom-build.yml
generated
vendored
18
.github/workflows/__swift-custom-build.yml
generated
vendored
|
|
@ -33,6 +33,10 @@ jobs:
|
||||||
version: cached
|
version: cached
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
version: cached
|
version: cached
|
||||||
|
- os: ubuntu-latest
|
||||||
|
version: nightly-latest
|
||||||
|
- os: macos-latest
|
||||||
|
version: nightly-latest
|
||||||
name: Swift analysis using a custom build command
|
name: Swift analysis using a custom build command
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
@ -44,15 +48,17 @@ jobs:
|
||||||
uses: ./.github/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: 5.7.0
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: swift
|
languages: swift
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
- name: Check working directory
|
||||||
|
shell: bash
|
||||||
|
run: pwd
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
@ -67,6 +73,6 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true'
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA.
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
CODEQL_ACTION_TEST_MODE: true
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
name: "Export file baseline information"
|
name: "Export file baseline information"
|
||||||
description: "Tests that file baseline information is exported when the feature is enabled"
|
description: "Tests that file baseline information is exported when the feature is enabled"
|
||||||
versions: ["nightly-latest"]
|
versions: ["nightly-latest"]
|
||||||
|
env:
|
||||||
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true # Remove when Swift is GA.
|
||||||
steps:
|
steps:
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Windows doesn't support Swift, and only macOS latest and nightly-latest support Swift 5.7.1.
|
|
||||||
if: runner.os == 'Linux' || (runner.os == 'macOS' && matrix.version == 'cached')
|
|
||||||
with:
|
|
||||||
swift-version: "5.7.0"
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
env:
|
env:
|
||||||
CODEQL_FILE_BASELINE_INFORMATION: true
|
CODEQL_FILE_BASELINE_INFORMATION: true
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
@ -22,7 +22,6 @@ steps:
|
||||||
output: "${{ runner.temp }}/results"
|
output: "${{ runner.temp }}/results"
|
||||||
env:
|
env:
|
||||||
CODEQL_FILE_BASELINE_INFORMATION: true
|
CODEQL_FILE_BASELINE_INFORMATION: true
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true
|
|
||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,18 @@
|
||||||
name: "Multi-language repository"
|
name: "Multi-language repository"
|
||||||
description: "An end-to-end integration test of a multi-language repository using automatic language detection"
|
description: "An end-to-end integration test of a multi-language repository using automatic language detection"
|
||||||
# Temporarily exclude nightly-latest to unblock release
|
|
||||||
versions: ["stable-20211005", "stable-20220120", "stable-20220401", "cached", "latest"]
|
|
||||||
operatingSystems: ["ubuntu", "macos"]
|
operatingSystems: ["ubuntu", "macos"]
|
||||||
env:
|
env:
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA.
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA.
|
||||||
steps:
|
steps:
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: "5.7.0"
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
db-location: "${{ runner.temp }}/customDbLocation"
|
db-location: "${{ runner.temp }}/customDbLocation"
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -69,7 +66,7 @@ steps:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check language autodetect for Swift
|
- name: Check language autodetect for Swift
|
||||||
if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')"
|
if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,19 @@ versions: ["latest", "cached", "nightly-latest"]
|
||||||
# Swift autobuilder is only supported on MacOS for private beta
|
# Swift autobuilder is only supported on MacOS for private beta
|
||||||
operatingSystems: ["macos"]
|
operatingSystems: ["macos"]
|
||||||
env:
|
env:
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true"
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA.
|
||||||
steps:
|
steps:
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: "5.7.0"
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: swift
|
languages: swift
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
- name: Check working directory
|
||||||
|
shell: bash
|
||||||
|
run: pwd
|
||||||
- uses: ./../action/autobuild
|
- uses: ./../action/autobuild
|
||||||
- uses: ./../action/analyze
|
- uses: ./../action/analyze
|
||||||
id: analysis
|
id: analysis
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,22 @@
|
||||||
name: "Swift analysis using a custom build command"
|
name: "Swift analysis using a custom build command"
|
||||||
description: "Tests creation of a Swift database using custom build"
|
description: "Tests creation of a Swift database using custom build"
|
||||||
# Temporarily exclude nightly-latest to unblock release
|
versions: ["latest", "cached", "nightly-latest"]
|
||||||
versions: ["latest", "cached"]
|
|
||||||
operatingSystems: ["ubuntu", "macos"]
|
operatingSystems: ["ubuntu", "macos"]
|
||||||
env:
|
env:
|
||||||
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true"
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA.
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
|
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
|
||||||
steps:
|
steps:
|
||||||
- uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723
|
|
||||||
# Only macOS latest and nightly-latest support Swift 5.7.1
|
|
||||||
if: runner.os == 'Linux' || matrix.version == 'cached'
|
|
||||||
with:
|
|
||||||
swift-version: "5.7.0"
|
|
||||||
- uses: ./../action/init
|
- uses: ./../action/init
|
||||||
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: swift
|
languages: swift
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/.github/setup-swift
|
||||||
|
with:
|
||||||
|
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||||
|
- name: Check working directory
|
||||||
|
shell: bash
|
||||||
|
run: pwd
|
||||||
- name: Build code
|
- name: Build code
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue