JohnSundell / Marathon

[DEPRECATED] Marathon makes it easy to write, run and manage your Swift scripts 🏃
MIT License
1.86k stars 78 forks source link

Adds Danger to the project #127

Closed orta closed 5 years ago

orta commented 7 years ago

Builds on #125

Figured this was a good as an integration case as I can think of. Adds Danger Swift to the travis file, I know it's supported in buddy build, but I'm less sure how to check how all that works.

orta commented 7 years ago

OK, that's confusing, why does the danger-swift repo allow a root Dangerfile, but not your repo? It seems to non-optional so I'll add support for an implicit danger/Dangerfile.swift also

JohnSundell commented 7 years ago

@orta I think that's because Danger-Swift uses Swift 4, while Marathon uses Swift 3.1. We should be able to use Swift 4 for Marathon as well. BuddyBuild already supports it, and it looks like swiftenv does too now (for Travis/Linux), using the 4.0-dev identifier (see https://github.com/kylef/swiftenv/releases/tag/1.3.0).

orta commented 7 years ago

Him, interesting that fails, might need to run on a Mac with XC9 (this was my initial implementation in travis) - will test that

JohnSundell commented 7 years ago

@orta Need any assistance with this one? I'd be happy to help - will have some free time this weekend 😄

orta commented 7 years ago

Ah yeah, it's mostly about getting swift 4 to work on linux

orta commented 7 years ago

Copying https://github.com/vapor/vapor/blob/master/circle.yml may help 👍

orta commented 7 years ago

I got 5m, will try it - it's on a branch so you can push too

orta commented 7 years ago

This is now much closer ( as I got the builds etc working on Swift 4 correctly inside the danger repo) the new issue lies inside marathon I think: https://travis-ci.org/JohnSundell/Marathon/builds/273308920#L657

$ ./.build/debug/Marathon install danger/danger-swift
🏃  Cloning <CFURL 0x1b05a40 [0x7f3163982870]>{string = https://github.com/danger/danger-swift.git, encoding = 134217984, base = (null)}...
   Compiling script...
   Installing binary...
💥  Failed to install script
👉  Make sure that you have write permissions to the path '/usr/local/bin/danger-swift' and that all parent folders exist
orta commented 7 years ago
screen shot 2017-09-08 at 10 11 30

May be travis related, works fine locally.

JohnSundell commented 7 years ago

Finally had some time to take a look at this in more detail. Looks like the problem actually is that Travis doesn't allow us to install Danger into /usr/local/bin. Looking at how SwiftENV does this (https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh), it installs it at a local path then adds it to the current $PATH to make it directly executable. Maybe we can try something similar here?

orta commented 7 years ago

No worries, you were at NSSpain, which IMO, is a great use of your time 🍡

Yeah, that does sound like a good path to me. This should probably only happen if there's an ENV var of "CI" set though.

orta commented 7 years ago

Thought about this last night, could check first if user has write access to /usr/local/bin/ - then if not, trying every separate folder inside ENV["PATH"]