mironal / TwitterAPIKit

Swift library for the Twitter API v1 and v2 🍷
MIT License
118 stars 23 forks source link

Linux support #121

Open mironal opened 2 years ago

mironal commented 2 years ago

We have confirmed that this branch is buildable, but due to limitations of XCTest and Swift, we have not been able to run tests on it.

120

codecov-commenter commented 2 years ago

Codecov Report

Merging #121 (63533d7) into main (7bbdd82) will decrease coverage by 0.04%. The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main     #121      +/-   ##
==========================================
- Coverage   87.43%   87.38%   -0.05%     
==========================================
  Files         263      264       +1     
  Lines        6627     6634       +7     
==========================================
+ Hits         5794     5797       +3     
- Misses        833      837       +4     
Impacted Files Coverage Δ
Sources/TwitterAPIKit/Extensions/Data.swift 97.56% <ø> (-0.91%) :arrow_down:
Sources/TwitterAPIKit/TwitterAPIKit.swift 100.00% <ø> (ø)
Sources/TwitterAPIKit/TwitterAPIResponse.swift 86.32% <0.00%> (-3.06%) :arrow_down:
Sources/TwitterAPIKit/Extensions/HMAC.swift 100.00% <100.00%> (ø)
Sources/TwitterAPIKit/OAuthHelper.swift 96.07% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

mironal commented 1 year ago

Update 2022/08/19

merge main branch.

❯ docker run -it -w /project -v `pwd`:/project --platform linux/x86_64 swift swift build
Building for debugging...
Build complete! (13.84s)
❯ docker run -it -w /project -v `pwd`:/project --platform linux/x86_64 swift swift test
Building for debugging...
/project/Tests/TwitterAPIKitTests/APIv1/Geo/GetGeoReverseGeocodeRequestV1Tests.swift:12:9: error: cannot find 'XCTContext' in scope
        XCTContext.runActivity(named: "ft") { _ in
        ^~~~~~~~~~
/project/Tests/TwitterAPIKitTests/APIv1/Geo/GetGeoReverseGeocodeRequestV1Tests.swift:35:9: error: cannot find 'XCTContext' in scope
        XCTContext.runActivity(named: "meter") { _ in

...

error: fatalError
Mcrich23 commented 1 year ago

Please add this!!!

Mcrich23 commented 1 year ago

@mironal Sourcery (one of your checks) wasn't able to run, because it wasn't running on macOS, thus failing. It seems that although it can theoretically run on GitHub, it prevents itself from doing so.

Mcrich23 commented 1 year ago

Additionally, I am running it on my vapor server in docker and it's working flawlessly

mironal commented 1 year ago

@Mcrich23 Thanks for your comment.

Sorry & Unfortunately this branch is not yet complete and will not be merged into the main branch.

If you are using Swift PM, you can specify this branch to use in your project.

When we update the main branch, this branch will continue to follow.

Mcrich23 commented 1 year ago

@mironal Ok, tysm. May I ask what is yet to be added?

mironal commented 1 year ago

@Mcrich23 We would like to merge it after successful testing in a Linux environment.

Currently, TwitterAPIKit tests cannot be compiled due to limitations of XCTest.

We are wondering whether we should make major modifications to the tests or wait for an XCTest update.

However, we do not feel the need to rush, as we can use this branch directly if we want to use it on Linux.

Do you have a reason to rush the merge to the main branch?

Mcrich23 commented 1 year ago

@mironal No, I just didn't realize at first that main didn't support linux and I am sure others will have the same issue. Maybe consider putting a note about it in the readme?

mironal commented 1 year ago

@Mcrich23 Thank you. I updated the README!

image
Mcrich23 commented 1 year ago

@mironal cool!

Mcrich23 commented 1 year ago

@mironal btw, it links to the pr request and not the branch itself

mironal commented 1 year ago

Updated: 2022/11/04

❯ docker run -it -w /project -v `pwd`:/project --platform linux/x86_64 swift swift build
Building for debugging...
[740/740] Compiling TwitterAPIKit TwitterRateLimit.swift
Build complete! (221.43s)