turion / essence-of-live-coding

Universal Live Coding & Functional Reactive Programming Framework
https://www.manuelbaerenz.de/#computerscience
62 stars 6 forks source link

Add github actions for CI #91

Closed miguel-negrao closed 2 years ago

miguel-negrao commented 2 years ago

Solves #87

miguel-negrao commented 2 years ago

Strange, the pull-request didn't trigger the action in this repo... Perhaps it's a security issue ?

miguel-negrao commented 2 years ago

Strange, the pull-request didn't trigger the action in this repo... Perhaps it's a security issue ?

Ok, needed to add "pull_request".

miguel-negrao commented 2 years ago

Doesn't build with ghc 9.2, some constraints would have to be relaxed I think. See here: https://github.com/miguel-negrao/essence-of-live-coding/runs/4780786282?check_suite_focus=true

miguel-negrao commented 2 years ago

Ok, it builds with cabal with 8.8 . I'll add that.

turion commented 2 years ago

Does adding GHC 9.0 work?

miguel-negrao commented 2 years ago

Does adding GHC 9.0 work?

No. I think the constraints on some packages probably need to be changed. Check the logs here: https://github.com/miguel-negrao/essence-of-live-coding/runs/4780786282?check_suite_focus=true

miguel-negrao commented 2 years ago

Ok, I have 8.8.4 and 8.10.7 working: https://github.com/miguel-negrao/essence-of-live-coding/runs/4781303652?check_suite_focus=true

miguel-negrao commented 2 years ago

Does adding GHC 9.0 work?

No. I think the constraints on some packages probably need to be changed. Check the logs here: https://github.com/miguel-negrao/essence-of-live-coding/runs/4780786282?check_suite_focus=true

9.0.2 also fails, with problems in eolc code: https://github.com/turion/essence-of-live-coding/runs/4781676336?check_suite_focus=true

I suggest for now start with 8.8 and 8.10.

miguel-negrao commented 2 years ago

Added a cabal flag to show the result of the tests

miguel-negrao commented 2 years ago

There's an issue with the version of base in the cabal.project.freeze ...

miguel-negrao commented 2 years ago

I think the issue is that we need a different cabal.project and cabal.project.freeze file for each version of ghc, similarly to stack. That can be done as explained here (edit: changed the linked, copy-past problem). Will try to look at it tomorrow. Curiously the freeze files can be created from stackage for the required ghc version.

turion commented 2 years ago

I think the issue is that we need a different cabal.project and cabal.project.freeze file for each version of ghc, similarly to stack.

Maybe I was wrong about the freeze files then. Maybe they simply shouldn't be committed.

I asked that on reddit now: https://www.reddit.com/r/haskell/comments/s4fcoy/should_i_commit_cabal_freeze_files_to_my_repo/?

For now, is it possible to simply overwrite the freeze file by calling cabal freeze again on CI? (Pretty much reverting to the state it was before I said to remove the cabal freeze step?)

That can be done as explained here.

Hmm, that issue doesn't seem to talk about cabal freeze. Sure it's the one you wanted to link?

miguel-negrao commented 2 years ago

Sorry, the link was wrong, copy-paste issue, fixed it.

The freeze file will also pin the base version to the exact version used by the solver, therefore it will only work with a specific version of ghc. I've added two project and freeze files for the two ghc versions, and they build correctly. I didn't add a cabal.project.freeze file because then people trying to build the library with cabal build all in their machine will not be able to do so unless they have the exact same ghc version, and that would be cumbersome I think. Stack doesn't have this problem as it will also fetch the right ghc as needed.

Does this look good ?

miguel-negrao commented 2 years ago

Squashed commits and cache seems to be working. The eolc libraries are always rebuilt but the dependencies are not.

miguel-negrao commented 2 years ago

The freeze files were created on my machine with

cabal freeze --project-file=cabal.project.8.8.4 -w ghc-8.8.4
cabal freeze --project-file=cabal.project.8.10.7 -w ghc-8.10.7
miguel-negrao commented 2 years ago

Removed stack.yaml.lock file, not needed anymore.

miguel-negrao commented 2 years ago

Currently the CI doesn't build on windows or macos as we would need to conditionally build essence-of-live-coding-pulse related packages. I think this would require a different cabal.project file for each OS too. See the log here. Good enough linux only for now ?

turion commented 2 years ago

Good enough linux only for now ?

Yes, definitely!

turion commented 2 years ago

Ideally, there would only be one cabal.project text file, and the others should be symbolic links to that one. Is that possible?

miguel-negrao commented 2 years ago

Ideally, there would only be one cabal.project text file, and the others should be symbolic links to that one. Is that possible?

Done.

turion commented 2 years ago

Awesome!