Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/__all-platform-bundle.yml

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

4 changes: 0 additions & 4 deletions .github/workflows/__build-mode-manual.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/__export-file-baseline-information.yml

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

28 changes: 24 additions & 4 deletions .github/workflows/__multi-language-autodetect.yml

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

6 changes: 0 additions & 6 deletions .github/workflows/__swift-custom-build.yml

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

4 changes: 1 addition & 3 deletions .github/workflows/__test-local-codeql.yml

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

15 changes: 12 additions & 3 deletions .github/workflows/__unset-environment.yml

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

5 changes: 2 additions & 3 deletions .github/workflows/debug-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test-codeql-bundle-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions pr-checks/checks/all-platform-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ steps:
- 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
Expand Down
4 changes: 0 additions & 4 deletions pr-checks/checks/build-mode-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pr-checks/checks/export-file-baseline-information.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 15 additions & 13 deletions pr-checks/checks/multi-language-autodetect.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: "An end-to-end integration test of a multi-language repository using automatic language detection for MacOS"
description: "An end-to-end integration test of a multi-language repository using automatic language detection"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 I added the bit about MacOS because the test actually no longer tests autodetect for MacOS (since I had to manually exclude Swift from the languages input).

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:
go-version: ">=1.21.0"

- uses: ./../action/init
id: init
if: runner.os == 'Linux'
with:
db-location: "${{ runner.temp }}/customDbLocation"
# 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/init
id: init-macos
if: runner.os == 'macOS'
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively we could make the languages input conditional, e.g. something like languages: ${{ runner.os == 'Linus' && 'cpp,csharp,go,java,javascript,python,ruby' || '' }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah that's a good point! I had thought that an empty languages input might cause us to run with no languages but it looks like we guard against that and turn autodetect on:

let rawLanguages = (languagesInput || "")
.split(",")
.map((x) => x.trim().toLowerCase())
.filter((x) => x.length > 0);
let autodetected: boolean;
if (rawLanguages.length) {
autodetected = false;
} else {
autodetected = true;
🧠 I'll make the change 👍

with:
db-location: "${{ runner.temp }}/customDbLocation"
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 }}
codeql-path: ${{ steps.init-macos.outputs.codeql-path }}

- name: Build code
shell: bash
Expand Down Expand Up @@ -72,8 +74,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 }}
Expand Down
2 changes: 1 addition & 1 deletion pr-checks/checks/swift-custom-build.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 1 addition & 3 deletions pr-checks/checks/test-local-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ steps:
- id: init
uses: ./../action/init
with:
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
Expand Down
13 changes: 2 additions & 11 deletions pr-checks/checks/unset-environment.yml
Original file line number Diff line number Diff line change
@@ -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
# 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 }}
- uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
Expand Down
2 changes: 1 addition & 1 deletion tests/multi-language-repo/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading