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

Implement Travis CI Build #13

Closed
jwood803 opened this issue Jul 6, 2014 · 29 comments
Closed

Implement Travis CI Build #13

jwood803 opened this issue Jul 6, 2014 · 29 comments

Comments

@jwood803
Copy link
Contributor

jwood803 commented Jul 6, 2014

After looking at a few other projects here on GitHub I've noticed that they were able to find a way to use Travis CI with .NET projects. After a bit of searching it seems there is a way to implement this.

I can definitely take a look at implementing this with F# and C#, but I'll admit I've never messed with these kinds of builds before.

@kytrinyx
Copy link
Member

kytrinyx commented Jul 6, 2014

It sounds like you know more about it than I do at this point :-)

This would be great if you can get it working. If not, don't sweat it!

@jwood803
Copy link
Contributor Author

jwood803 commented Jul 6, 2014

I'll do my best, but I've never messed with it before. I'm sure I may ask tons of questions somewhere. :P

-----Original Message-----
From: "Katrina Owen" [email protected]
Sent: ‎7/‎6/‎2014 11:40 AM
To: "exercism/xfsharp" [email protected]
Cc: "Jon" [email protected]
Subject: Re: [xfsharp] Implement Travis CI Build (#13)

It sounds like you know more about it than I do at this point :-)
This would be great if you can get it working. If not, don't sweat it!

Reply to this email directly or view it on GitHub.

@jwood803
Copy link
Contributor Author

I think AppVeyor would be a good start with this since it directly supports .NET. If that's good, I'll work on Travis to get it going with Mono.

@kytrinyx
Copy link
Member

Cool, thanks for the update.

@jwood803
Copy link
Contributor Author

No problem! It seems like this should work. I'm pretty sure I can at least make sure everything compiles but I want to see if I can get all the tests run as well.

@ErikSchierboom
Copy link
Member

As far as I can tell, the Travis build works nicely. So perhaps this issue can be closed?

@jwood803
Copy link
Contributor Author

I was hoping to add FAKE to it so it can actually build and run the tests. Unfortunately, I haven't gotten too far with it 😞

@ErikSchierboom
Copy link
Member

@jwood803 Have you consider using AppVeyor?

@jwood803
Copy link
Contributor Author

I've started to :}

Maybe I should pick this back up. Would be great to learn more on FAKE.

@ErikSchierboom
Copy link
Member

Cool, appveyor is a really nice tool. FAKE is something I wanted to get to learn to for a long time. Might look into it soon.

@ErikSchierboom
Copy link
Member

@jwood803 I've been looking into FAKE lately, and I think I can be of assistance here. The only thing is that FAKE expects a project or solution file as far as I can tell, and we don't have one. Should we create one?

@jwood803
Copy link
Contributor Author

Awesome! I might still have a branch there with my changes so far.

I was attempting to compile the files directly since FAKE exposes the F# compiler. You have any thoughts on that approach?

On Jan 24, 2016, at 7:28 AM, Erik Schierboom [email protected] wrote:

@jwood803 I've been looking into FAKE lately, and I think I can be of assistance here. The only thing is that FAKE expects a project or solution file as far as I can tell, and we don't have one. Should we create one?


Reply to this email directly or view it on GitHub.

@ErikSchierboom
Copy link
Member

I haven't looked into that yet. Do you have any sample code?

@jwood803
Copy link
Contributor Author

Not complete at all but here's what I've started on - https://github.com/jwood803/xfsharp/blob/build/build.fsx

On Jan 24, 2016, at 11:21 AM, Erik Schierboom [email protected] wrote:

I haven't looked into that yet. Do you have any sample code?


Reply to this email directly or view it on GitHub.

@ErikSchierboom
Copy link
Member

Thanks, I'll see if I can get something working.

@jwood803
Copy link
Contributor Author

Awesome! I'll be glad to help, as well, if anything comes up.

On Jan 24, 2016, at 1:00 PM, Erik Schierboom [email protected] wrote:

Thanks, I'll see if I can get something working.


Reply to this email directly or view it on GitHub.

@ErikSchierboom
Copy link
Member

I managed to get something working! You can find the code in my fake-testing branch.

Here is how it works:

  • You execute the build using build.ps1 (once that is done, I'll work on a shell version).
  • The build.sh1 file uses FAKE to execute build.fsx

The build script does the following things, in order:

  • Clean the build directory (defaults to "./build").
  • Copies the exercises directory to the build directory.
  • The copied .fs files in the build directory are modified to strip any Ignore attributes. Otherwise most tests would not run.
  • Use the F# compiler service to create a DLL from the modified .fs files in the build directory.
  • Use the NUnit 3 console runner to run the tests (the NUnit 2 console runner failed).

And that's it! All tests are then run (they all pass by the way):

image

Now what is left is to decide are some details. For example, do we want the .ps1 script to download any (NuGet) dependencies (like NUnit, the NUnit console runner and FAKE)? At the moment, I've included the dependencies in the repository, but that could be left out of course. And do we also want to download NuGet itself from the build script?

@jwood803
Copy link
Contributor Author

@ErikSchierboom That's awesome! Looks like you did much better than I did. :]

Usually dependencies are left out and the .sh or .ps script will redownload if they aren't found using NuGet or Paket.

@ErikSchierboom
Copy link
Member

@jwood803 Okay, I'll modify the script to download ll dependencies then.

@ErikSchierboom
Copy link
Member

@jwood803 I've updated the script to download the dependencies, added a UNIX bash script and submitted it as a PR. Could you check if things work as you expect?

@jwood803
Copy link
Contributor Author

jwood803 commented Feb 1, 2016

Awesome! I'll check it out over the next day or two. I also don't see why we can't do the same in the C# repository. I believe FAKE can use the C# compiler, as well.

@ErikSchierboom
Copy link
Member

Well, I already searched for that but I could not find anything about Roslyn. Maybe that would require us to write a FAKE plugin?

@jwood803
Copy link
Contributor Author

jwood803 commented Feb 2, 2016

The CscHelper wouldn't work? Granted, I'm just speculating and haven't used it.

@ErikSchierboom
Copy link
Member

Whoops! I totally missed that. I was searching for Roslyn and came up empty. This looks promising! I'll be looking at that later.

@ErikSchierboom
Copy link
Member

This is fixed by PR #55.

@jwood803
Copy link
Contributor Author

jwood803 commented Feb 3, 2016

@ErikSchierboom
Copy link
Member

@jwood803 Yes, the FscHelper module is what I use in my FAKE script. I'm very happy everything works :)

@jwood803
Copy link
Contributor Author

jwood803 commented Feb 3, 2016

Nice! It must have just been updated. I think I saw the last commit to it was around 24 hours ago from now.

@ErikSchierboom
Copy link
Member

@jwood803 Indeed. Next up is checking to see if I can get something to work for the C# track.

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

No branches or pull requests

3 participants