awesome-system-swift
awesome-system-swift copied to clipboard
On Continuous Integration
@vknabel had a really great idea about how to add CI such that we could test the projects both periodically and before merging a PR, to see that they worked on both Darwin and Linux.
These are the benefits:
- This helps us maintain our goal of listing cross-platform libraries.
- This helps a contributor (and us!) know what might be missing in a newly added project, instantly and with extensive feedback.
And this is (more or less) the idea as I can recall it:
- Parse the document for links, and check if the repo has the structure of a Swift SPM project. If not, whatevs.
- If yes, then download it and run
swift test
. Collect the results (passed/total and console output) into a list. - Display the results in the PR.
This would be enhanced by tools such as that described by #31
A draft of the current approach is located here: vknabel/awesome-system-swift#1
The problem is using danger swift: I could not get it running https://travis-ci.org/vknabel/awesome-system-swift/builds/370196293
(Sorry if my writing has been sloppy, when I wrote these issues I was very tired)
Do you think it's possible to do this? Tell me where can I help you :)
(Sorry if my writing has been sloppy, when I wrote these issues I was very tired)
No worries :)
I got Danger-Swift to work for now.
Though I use NSURLConnection.sendSynchronousRequest
in order to download the pr-diffs.
Sadly it is not available on linux. Can you have a look on this?
https://github.com/vknabel/CompatabilityDetection/blob/master/Sources/CompatabilityDetection/CompatabilityDetection.swift#L95-L100
Awesome!
And,
Can you have a look on this?
Sure :) I have to leave for class soon, but I'll be back later. I'll check it out then!
That function seems to be deprecated, take a look at this.
I'm going to check out what the Web projects like Vapor and Kitura do. In the case there's nothing Swift-based we could use (which I don't believe is likely), we at least have the CCUrl wrapper that IBM made as a last resort.
Huh. Seems like the entire NSURLConnection
API is getting slowly deprecated. The replacement for it is based around URLSession
, which in the corelibs-foundation
repo seems to be mostly complete (open and then Ctrl
+ F
: "urlsession" for the details). Do you think we could use that instead?
As an alternative, I've found Vapor's HTTPRequest. Since Vapor's API is 100% implememted, that's a solid option if the corelibs-foundation
alternative can't be used.
Thanks a lot. I used URLSession
and semaphores to get the synchronous behavior.
My testing PR did actually pass. 🎉 Now I need to start playing around and improve some parts (compile errors should fail, but missing tests should just warn)