Add warning and update PR checks for Swift on Linux (#2399)
* PR checks: Only run Swift build command on MacOS * PR checks: update to only test Swift on MacOS * Log warning if workflow is running Swift on Ubuntu --------- Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This commit is contained in:
parent
8b7d7393fb
commit
9c646c24a4
20 changed files with 66 additions and 64 deletions
5
.github/workflows/__all-platform-bundle.yml
generated
vendored
5
.github/workflows/__all-platform-bundle.yml
generated
vendored
|
|
@ -60,10 +60,9 @@ jobs:
|
|||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
4
.github/workflows/__build-mode-manual.yml
generated
vendored
4
.github/workflows/__build-mode-manual.yml
generated
vendored
|
|
@ -74,10 +74,6 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
2
.github/workflows/__export-file-baseline-information.yml
generated
vendored
|
|
@ -86,7 +86,7 @@ jobs:
|
|||
run: |
|
||||
cd "$RUNNER_TEMP/results"
|
||||
expected_baseline_languages="c csharp go java kotlin javascript python ruby"
|
||||
if [[ $RUNNER_OS != "Windows" ]]; then
|
||||
if [[ $RUNNER_OS == "macOS" ]]; then
|
||||
expected_baseline_languages+=" swift"
|
||||
fi
|
||||
|
||||
|
|
|
|||
18
.github/workflows/__multi-language-autodetect.yml
generated
vendored
18
.github/workflows/__multi-language-autodetect.yml
generated
vendored
|
|
@ -29,14 +29,24 @@ jobs:
|
|||
include:
|
||||
- os: macos-12
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: macos-12
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: macos-12
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.14.6
|
||||
- os: macos-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.15.5
|
||||
- os: macos-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.16.6
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
|
|
@ -85,9 +95,13 @@ jobs:
|
|||
id: init
|
||||
with:
|
||||
db-location: ${{ runner.temp }}/customDbLocation
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby'
|
||||
|| '' }}
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
if: runner.os == 'macOS'
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
|
||||
|
|
@ -139,8 +153,8 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check language autodetect for Swift
|
||||
if: runner.os != 'Windows' && matrix.version != 'stable-20230403'
|
||||
- name: Check language autodetect for Swift on MacOS
|
||||
if: runner.os == 'macOS' && matrix.version != 'stable-20230403'
|
||||
shell: bash
|
||||
run: |
|
||||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
||||
|
|
|
|||
6
.github/workflows/__swift-custom-build.yml
generated
vendored
6
.github/workflows/__swift-custom-build.yml
generated
vendored
|
|
@ -29,16 +29,10 @@ jobs:
|
|||
include:
|
||||
- os: macos-latest
|
||||
version: linked
|
||||
- os: ubuntu-latest
|
||||
version: linked
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
name: Swift analysis using a custom build command
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
|
|||
5
.github/workflows/__test-local-codeql.yml
generated
vendored
5
.github/workflows/__test-local-codeql.yml
generated
vendored
|
|
@ -66,10 +66,9 @@ jobs:
|
|||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
tools: ./codeql-bundle-linux64.tar.gz
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
15
.github/workflows/__unset-environment.yml
generated
vendored
15
.github/workflows/__unset-environment.yml
generated
vendored
|
|
@ -27,6 +27,16 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
|
|
@ -65,10 +75,9 @@ jobs:
|
|||
id: init
|
||||
with:
|
||||
db-location: ${{ runner.temp }}/customDbLocation
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.21.0'
|
||||
|
|
|
|||
5
.github/workflows/debug-artifacts.yml
vendored
5
.github/workflows/debug-artifacts.yml
vendored
|
|
@ -52,9 +52,8 @@ jobs:
|
|||
debug: true
|
||||
debug-artifact-name: my-debug-artifacts
|
||||
debug-database-name: my-db
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
5
.github/workflows/test-codeql-bundle-all.yml
vendored
5
.github/workflows/test-codeql-bundle-all.yml
vendored
|
|
@ -42,10 +42,9 @@ jobs:
|
|||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
4
lib/init-action.js
generated
4
lib/init-action.js
generated
|
|
@ -188,6 +188,10 @@ async function run() {
|
|||
core.exportVariable("GOFLAGS", goFlags);
|
||||
core.warning("Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action.");
|
||||
}
|
||||
if (config.languages.includes(languages_1.Language.swift) &&
|
||||
process.platform === "linux") {
|
||||
logger.warning(`Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner if this affects you.`);
|
||||
}
|
||||
if (config.languages.includes(languages_1.Language.go) &&
|
||||
process.platform === "linux") {
|
||||
try {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -7,10 +7,9 @@ steps:
|
|||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@ steps:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ steps:
|
|||
run: |
|
||||
cd "$RUNNER_TEMP/results"
|
||||
expected_baseline_languages="c csharp go java kotlin javascript python ruby"
|
||||
if [[ $RUNNER_OS != "Windows" ]]; then
|
||||
if [[ $RUNNER_OS == "macOS" ]]; then
|
||||
expected_baseline_languages+=" swift"
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,6 @@
|
|||
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 for MacOS"
|
||||
operatingSystems: ["macos", "ubuntu"]
|
||||
excludeOsAndVersionCombination: [
|
||||
# Known failure for Swift on Linux before CLI v2.17.4.
|
||||
[ "ubuntu", "stable-20230403" ],
|
||||
[ "ubuntu", "stable-v2.13.5" ],
|
||||
[ "ubuntu", "stable-v2.14.6" ],
|
||||
[ "ubuntu", "stable-v2.15.5" ],
|
||||
[ "ubuntu", "stable-v2.16.6" ],
|
||||
]
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
|
|
@ -18,9 +10,12 @@ steps:
|
|||
id: init
|
||||
with:
|
||||
db-location: "${{ runner.temp }}/customDbLocation"
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby' || '' }}
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
if: runner.os == 'macOS'
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
|
||||
|
|
@ -72,8 +67,8 @@ steps:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check language autodetect for Swift
|
||||
if: runner.os != 'Windows' && matrix.version != 'stable-20230403'
|
||||
- name: Check language autodetect for Swift on MacOS
|
||||
if: runner.os == 'macOS' && matrix.version != 'stable-20230403'
|
||||
shell: bash
|
||||
run: |
|
||||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
name: "Swift analysis using a custom build command"
|
||||
description: "Tests creation of a Swift database using custom build"
|
||||
versions: ["linked", "default", "nightly-latest"]
|
||||
operatingSystems: ["macos", "ubuntu"]
|
||||
operatingSystems: ["macos"]
|
||||
env:
|
||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -12,10 +12,9 @@ steps:
|
|||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
tools: ./codeql-bundle-linux64.tar.gz
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
|
|
|||
|
|
@ -1,24 +1,15 @@
|
|||
name: "Test unsetting environment variables"
|
||||
description: "An end-to-end integration test that unsets some environment variables"
|
||||
operatingSystems: ["ubuntu"]
|
||||
excludeOsAndVersionCombination: [
|
||||
# Known failure for Swift on Linux before CLI v2.17.4.
|
||||
[ "ubuntu", "stable-20230403" ],
|
||||
[ "ubuntu", "stable-v2.13.5" ],
|
||||
[ "ubuntu", "stable-v2.14.6" ],
|
||||
[ "ubuntu", "stable-v2.15.5" ],
|
||||
[ "ubuntu", "stable-v2.16.6" ],
|
||||
]
|
||||
|
||||
steps:
|
||||
- uses: ./../action/init
|
||||
id: init
|
||||
with:
|
||||
db-location: ${{ runner.temp }}/customDbLocation
|
||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.21.0'
|
||||
|
|
|
|||
|
|
@ -333,6 +333,15 @@ async function run() {
|
|||
);
|
||||
}
|
||||
|
||||
if (
|
||||
config.languages.includes(Language.swift) &&
|
||||
process.platform === "linux"
|
||||
) {
|
||||
logger.warning(
|
||||
`Swift analysis on Ubuntu runner images is no longer supported. Please migrate to a macOS runner if this affects you.`,
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
config.languages.includes(Language.go) &&
|
||||
process.platform === "linux"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ javac Main.java
|
|||
|
||||
go build main.go
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* || "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
swift build
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue