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

ci: Finish migration to Github Actions #604

Merged
merged 17 commits into from
Sep 19, 2024
Merged

ci: Finish migration to Github Actions #604

merged 17 commits into from
Sep 19, 2024

Conversation

FranzBusch
Copy link
Member

Motivation

I made more progress on the reusable workflows in NIO so it's even easier to adopt them.

Modification

This PR fixes up the renamed workflow references and adds unit tests and cxx-interop checks.

Result

Green GH actions CI

@FranzBusch FranzBusch force-pushed the fb-gha-update branch 2 times, most recently from 1533aed to 62111dd Compare July 24, 2024 10:29
# Motivation

I made more progress on the reusable workflows in NIO so it's even easier to adopt them.

# Modification

This PR fixes up the renamed workflow references and adds unit tests and cxx-interop checks.

# Result

Green GH actions CI
@FranzBusch
Copy link
Member Author

@simonjbeaumont @czechboy0 Would appreciate some eyes on the failing format check

@czechboy0
Copy link
Contributor

@simonjbeaumont @czechboy0 Would appreciate some eyes on the failing format check

I suspect you want to add Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources to the ignore list for swift-format.

@czechboy0
Copy link
Contributor

See here:

| grep -z -v -e 'Tests/OpenAPIGeneratorReferenceTests/Resources' \

@czechboy0
Copy link
Contributor

@FranzBusch It's still failing, seems the Generated entry isn't working, it's meant to match the word Generated anywhere in the path. The affected paths here are e.g. Examples/manual-generation-generator-cli-example/Sources/ManualGeneratorInvocationClient/Generated/Client.swift

@czechboy0
Copy link
Contributor

Ok, soundness is failing now:

** Running /code/scripts/check-license-headers.sh...
** ERROR: Unsupported file extension for file (exclude or update this script): .swiftformatignore

I think it just requires you to add .swiftformatignore to the ignore list in scripts/check-license-headers.sh

@FranzBusch FranzBusch force-pushed the fb-gha-update branch 2 times, most recently from 22c757e to 2889fa0 Compare July 24, 2024 14:26
@FranzBusch
Copy link
Member Author

@czechboy0 @simonjbeaumont This passes the format check now. Please take a look at the changes. I also added the integration tests and example tests here. Once we have this merged the only thing that is missing is

  • Turning on the license check and turning off the old CI
  • Adding the compatibility test

@FranzBusch
Copy link
Member Author

Just realised I have to change something in the reusable workflow to get the integration tests to pass

@FranzBusch FranzBusch closed this Aug 19, 2024
@FranzBusch FranzBusch reopened this Aug 19, 2024
@FranzBusch FranzBusch force-pushed the fb-gha-update branch 3 times, most recently from a9d8e33 to 793e80b Compare August 19, 2024 18:02
@simonjbeaumont
Copy link
Contributor

@FranzBusch noticed this got reopened. Should I assume it's still a WIP for now and wait for a ping from you to review?

@FranzBusch
Copy link
Member Author

@simonjbeaumont @czechboy0 This PR is ready to review. The CI is all passing. I only had to skip the unacceptable language mode check and the shell check steps. I leave this up to you to re-enable them. The language mode depends on the old soundness CI to remove the text file with the words and the shell check depends on fixing up a few scripts. I would also encourage you to look into the examples CI and if you can reduce build times by using the same build dirs. You are currently rebuilding the same dependencies multiple times.

@FranzBusch
Copy link
Member Author

The compatibility test is also missing but similarly to the above could you please set that up in a follow up. It would be a good exercise to see if the reusable workflows give you want you need.

@czechboy0
Copy link
Contributor

Looks broadly good to me, but I'll let @simonjbeaumont review more closely and sign off.

Copy link
Contributor

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

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

Thanks for all the work here @FranzBusch! Left some comments.

.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
@FranzBusch
Copy link
Member Author

@simonjbeaumont Gentle ping. I think we can merge this. It should replicate everything that Jenkins is currently providing.

@simonjbeaumont
Copy link
Contributor

I'll take this, this week. Sorry for letting it linger.

Copy link
Contributor

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

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

@FranzBusch this is now at a state where I'm happy with it.

I realise this was initially your PR, but could you take a look.

@czechboy0 once @FranzBusch and I are aligned. I think you should give it a look too :)

@simonjbeaumont
Copy link
Contributor

@FranzBusch I'm happy with this now and so is Honza. Can you do a final pass with your Github Actions hat on and then hit merge? :)

Comment on lines +26 to +27
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
Copy link
Member Author

Choose a reason for hiding this comment

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

Should we track enabling warnings as errors for those pipelines at some point?

Copy link
Contributor

Choose a reason for hiding this comment

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

More than happy to. But that's over-and-above what we currently had in this project. We can track it separately.

Comment on lines +12 to +19
broken_symlink_check_enabled: true
docs_check_enabled: true
format_check_enabled: true
license_header_check_enabled: true
license_header_check_project_name: "SwiftOpenAPIGenerator"
shell_check_enabled: true
unacceptable_language_check_enabled: true
Copy link
Member Author

Choose a reason for hiding this comment

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

Why are we enabling them explicitly? The default is true

Copy link
Contributor

Choose a reason for hiding this comment

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

Because it's more visible. The fact that some are default to true and some to false is confusing IMO. I like to be able to see what tests we're running in the YAML.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am fine with explicitly stating but just to be clear no check is defaulting to false.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, my mistake. Thanks for confirming :)

matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && ./scripts/run-integration-test.sh"
matrix_linux_5_8_enabled: false
matrix_linux_nightly_main_enabled: false
Copy link
Member Author

Choose a reason for hiding this comment

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

Why not run them on the nightly main?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because it's materially slower and not blocking a PR. Note that this PR does use the nightly Swift versions in the scheduled workflow so we'll still be alerted. I'd really like to only have PR pipelines that are gating PR merges, especially when we have external contributors.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am surprised. Nightly main is slower than nightly 6.0? If so we should report that since this hints at a compiler speed regression.

Copy link
Contributor

Choose a reason for hiding this comment

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

No no. It's slower because it's far less likely to have the image available.

What's really annoying (but I realise a Github Action limitation) is that this will still do a bunch of the warmup anyway because the if: false is only at the step-level.

I have some ideas on how we can make that better though, if you're open to them.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have some ideas here as well. We could dynamically generate the matrix instead of having it hard coded like now.

matrix_linux_command: "./scripts/test-examples.sh"
matrix_linux_5_8_enabled: false
matrix_linux_nightly_main_enabled: false
Copy link
Member Author

Choose a reason for hiding this comment

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

Same here. Why not nightly?

Copy link
Contributor

Choose a reason for hiding this comment

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

Answered above.

@@ -26,25 +26,25 @@ services:

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you intend to keep the docker files around?

Copy link
Contributor

Choose a reason for hiding this comment

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

I hadn't actually considered removing them altogether but I guess the only downside to doing so is that the existing CI will immediately fail because it can't find them. Maybe that's fine since we want it turned off anyway.

@czechboy0 any objections to me just deleting all the docker-based CI files?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, let's get us moved over fully.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, I've realised that if we do this we'll be full of red X's on all PRs until we get them turned off because they'll still fire on the webhooks. Let's stage this in, get them turned off, then remove the files.

Copy link
Member Author

Choose a reason for hiding this comment

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

You can turn off the web hooks yourself in the repo settings.

@FranzBusch
Copy link
Member Author

I can't approve since I am the author but LGTM!

@simonjbeaumont simonjbeaumont changed the title [GHA] Update to the latest workflows ci: Finish migration to Github Actions Sep 19, 2024
@simonjbeaumont simonjbeaumont merged commit 632b68f into main Sep 19, 2024
33 checks passed
@simonjbeaumont simonjbeaumont deleted the fb-gha-update branch September 19, 2024 08:26
simonjbeaumont added a commit that referenced this pull request Sep 19, 2024
### Motivation

In #604 we enabled all the Github Actions based workflows we need for
CI. Since then we have updated the branch protection rules and disabled
the webhook for the old CI, so we can remove the Docker Compose files
that were used by the old CI.

### Modifications

Delete the Docker Compose files.

### Result

Less clutter in the repo.

### Test Plan

This PR should show the new, Github Actions CI checks, and shouldn't be
showing any of the older CI jobs. If that's true, we are safe to remove
them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants