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

Add github actions for CI #91

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

miguel-negrao
Copy link
Contributor

  • update vivid to 0.5.2.0 in order to build with latest hashable. This version adds an Eq instance for SynthDef, which therefore doesn't need to be defined in this repo.

Solves #87

@miguel-negrao
Copy link
Contributor Author

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

@miguel-negrao
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@turion
Copy link
Owner

turion commented Jan 11, 2022

Does adding GHC 9.0 work?

@turion turion mentioned this pull request Jan 11, 2022
@miguel-negrao
Copy link
Contributor Author

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
Copy link
Contributor Author

@miguel-negrao miguel-negrao force-pushed the test_github_workflow branch 2 times, most recently from f365388 to 97e4328 Compare January 11, 2022 21:41
@miguel-negrao
Copy link
Contributor Author

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
Copy link
Contributor Author

Added a cabal flag to show the result of the tests

This was referenced Jan 14, 2022
.github/workflows/ci.yml Outdated Show resolved Hide resolved
uses: freckle/stack-cache-action@v1.0.1
with:
stack-yaml: stack.yaml
- name: Stack build and test (lts-18.21 - ghc 8.10.7)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to have a matrix over different stack versions as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a lot insight into that, but I don't think it is needed. If we did that then we should also have a matrix over cabal versions. For instance on this repo they use a single cabal and stack version each. Our stack files don't use anything advanced only available on the latest version, it should work fine on older versions I believe, but if we want to be sure we can always run it once with a matrix over stack and see what is the result.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I actually meant different stackage versions (i.e. not only lts-18.21, but also the older ones).

@miguel-negrao
Copy link
Contributor Author

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

@miguel-negrao
Copy link
Contributor Author

miguel-negrao commented Jan 14, 2022

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
Copy link
Owner

turion commented Jan 15, 2022

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 miguel-negrao force-pushed the test_github_workflow branch 2 times, most recently from 2eb369f to b4aaf6f Compare January 15, 2022 10:09
@miguel-negrao
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@miguel-negrao
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@miguel-negrao
Copy link
Contributor Author

miguel-negrao commented Jan 15, 2022

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
Copy link
Owner

turion commented Jan 18, 2022

Good enough linux only for now ?

Yes, definitely!

@turion
Copy link
Owner

turion commented Jan 18, 2022

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

- Build and test with cabal and stack for GHC 8.8.4 and 8.10.7

- update vivid to 0.5.2.0 in order to build with latest hashable. This version adds an Eq instance for SynthDef, which therefore doesn't need to be defined in this repo.
@miguel-negrao
Copy link
Contributor Author

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
Copy link
Owner

turion commented Jan 19, 2022

Awesome!

@turion turion merged commit 11e6922 into turion:master Jan 19, 2022
@miguel-negrao miguel-negrao deleted the test_github_workflow branch January 19, 2022 16:11
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

Successfully merging this pull request may close these issues.

None yet

2 participants