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 warning and update PR checks for Swift on Linux #2399

Merged
merged 8 commits into from
Aug 2, 2024

Conversation

angelapwen
Copy link
Contributor

@angelapwen angelapwen commented Jul 31, 2024

We are deprecating Swift support on Linux for code scanning (changenote in #2403).

This PR logs a warning for users in the init Action if it's determined that Swift on Linux is being run.

This change also updates the manual build script build.sh which we also use in internal repositories for testing: the swift command will only be run on MacOS rather than on both MacOS and Linux.

As a result, we can also update our PR checks that only test on Linux, to remove the setup-swift Action step as it is no longer needed; and other checks that look for the existence of Swift databases on Linux.

I've removed Swift analysis using a custom build command check on Linux images from required checks for main, releases/v3, and releases/v2 already as well.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@angelapwen angelapwen force-pushed the angelapwen/stop-testing-swift-linux branch 3 times, most recently from 7bac0e4 to c470a9e Compare July 31, 2024 13:48
@angelapwen angelapwen force-pushed the angelapwen/stop-testing-swift-linux branch 3 times, most recently from cb826c1 to d0fa9dd Compare July 31, 2024 14:00
@angelapwen angelapwen force-pushed the angelapwen/stop-testing-swift-linux branch from d0fa9dd to ea4581b Compare July 31, 2024 14:20
@angelapwen angelapwen marked this pull request as ready for review July 31, 2024 14:47
@angelapwen angelapwen requested a review from a team as a code owner July 31, 2024 14:47
henrymercer
henrymercer previously approved these changes Jul 31, 2024
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Looks good, a couple of suggestions

@@ -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).

Comment on lines 10 to 19
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 👍

@angelapwen angelapwen changed the title PR checks: stop testing Swift on Linux Add warning and update PR checks for Swift on Linux Aug 2, 2024
@angelapwen angelapwen mentioned this pull request Aug 2, 2024
3 tasks
@angelapwen angelapwen requested a review from aeisenberg August 2, 2024 12:54
aeisenberg
aeisenberg previously approved these changes Aug 2, 2024
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good after the typo is fixed.

src/init-action.ts Outdated Show resolved Hide resolved
Co-authored-by: Andrew Eisenberg <[email protected]>
@angelapwen angelapwen added the Rebuild Re-transpile JS & re-generate workflows label Aug 2, 2024
@github-actions github-actions bot removed the Rebuild Re-transpile JS & re-generate workflows label Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

Pushed a commit to rebuild the Action. Please mark the PR as ready for review to trigger PR checks.

@github-actions github-actions bot marked this pull request as draft August 2, 2024 13:56
@angelapwen angelapwen marked this pull request as ready for review August 2, 2024 13:56
@angelapwen
Copy link
Contributor Author

Huh.. not sure why the Unit Test workflow isn't being picked up. I'll push an empty commit to try to force it to run.

@angelapwen angelapwen merged commit 9c646c2 into main Aug 2, 2024
312 checks passed
@angelapwen angelapwen deleted the angelapwen/stop-testing-swift-linux branch August 2, 2024 14:27
@github-actions github-actions bot mentioned this pull request Aug 6, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants