-
Notifications
You must be signed in to change notification settings - Fork 74
Implement --matrix-extra for more matrix dimensions #462
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
Conversation
Please don't add new packages to test-suite, if not strictly necessary. I wonder what |
7404243
to
d2b6ad2
Compare
notmuch is a mail indexer. I maintain a Haskell binding. It's one of the projects this PR will help with - for testing with different versions of libnotmuch. I wanted a .cabal with shorter Are you comfortable with the general approach of this PR? Are there any other changes you would like to make? (naming, etc?) I'm about to crash for the night but I'll address all your feedback tomorrow. |
I'm not sure. I feel that then someone would ask to have away to filter the cartesian product etc. I have to think about this properly. |
@phadej some final arguments in support of this feature:
I hope you will decide in favour of this feature. Let me know of any changes you would like. |
d2b6ad2
to
ca2b740
Compare
Rebased to resolve merge conflicts. |
-_- I'll sort out those failing tests on the weekend, hopefully! |
ca2b740
to
f97953b
Compare
f97953b
to
d3b166d
Compare
I am reviving this PR. The need still exists (and always will). I changed the tests to avoid adding notmuch. The golden tests now use splitmix instead. I also added a check (with corresponding test) that the matrix size does not exceed GitHub's limit of 256 jobs. |
d3b166d
to
d0a1297
Compare
d0a1297
to
ca21505
Compare
@phadej ping - could you please review and consider merging this PR? |
ca21505
to
fd008f0
Compare
Annual ping... I have rebased and resolved conflicts (waiting to see if tests pass - will address them if not) and once again ask for a determination about this PR. |
Sometimes you need to test your project along more dimensions than just GHC version. This is particularly important for programs/libraries that use FFI to bind to libraries - they might need to be tested against a range of library versions. In general, you want to test all the combinations of GHC versions and other properties, i.e. the cartesian product. It is burdensome for maintainers that need such a strategy to manually adjust the matrix after every (re)generation of the CI script/spec. Better tool support for this scenario is warranted. This commit implements a new --matrix-extra option, which adds additional matrix dimensions. The option value format is: --matrix-extra libfoo:2.6,3.0;libbar:0.1,0.2 haskell-ci adds all the combinations of GHC version and the --matrix-extra fields to the matrix. Corresponding build/test steps can be introduced via --github-patches (or --travis-patches). This commit implements this feature for GitHub actions only. Additionally, we check and enforce the job limit imposed by GitHub (currently 256 jobs per workflow).
fd008f0
to
e12bed2
Compare
Another rebase and test fixture update... @phadej would you consider merging this? There is a real need for it, especially for projects that use system binaries or libraries and support multiple versions thereof. |
As you have to use patches anyway, you can do this with a small patch. See #785 continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
+ compiler: [ghc-9.10.2,ghc-9.8.4,ghc-9.6.7,ghc-9.4.8,ghc-9.2.8,ghc-9.0.2,ghc-8.10.7,ghc-8.8.4]
+ animal: [cat, dog]
include:
- compiler: ghc-9.10.2
compilerKind: ghc It would make sense to make |
@phadej I tried this approach before pivoting to the current proposal. It didn't work well because the patch will need updating every time the GHC list changes (otherwise conflicts), which defeats the purpose. |
The extra dimension could also be put somewhere where it doesn't conflict as easily (i.e. after IMO, if you are using patches, conflicts are to be expected. |
Until you drop support for old versions and stop testing them. You could reduce the number of context lines to slip it in ahead of
They do happen, but far less often than changes to the GHC versions I'm testing. In other words, Genuinely, what is the hesitation to accepting this change? You previously mentioned that some people might want to filter the matrix further, but right now there's not even a robust way to produce the extra matrix dimension(s). It solves the problem well for me - much better than the alternative proposals. I've been carrying the patch and using it in anger for 4.5 years. Let me know if there's anything I can do to make this patch acceptable :) |
I don't like patch feature. It's currently a necessary evil. But it's bad. I don't like In both cases, there are missing features, i'd rather work on them. |
I'll add |
Testing your project across multiple values related to non-Haskell dependencies is one such missing feature. Here are some ideas for how
Do either of these approaches seem acceptable? |
Sometimes you need to test your project along more dimensions than just GHC
version. This is particularly important for programs/libraries that use
FFI to bind to libraries - they might need to be tested against a range of
library versions.
In general, you want to test all the combinations of GHC versions and other
properties, i.e. the cartesian product. It is burdensome for maintainers
that need such a strategy to manually adjust the matrix after every
(re)generation of the CI script/spec. Better support for this scenario in
haskell-ci is warranted.
This commit implements a new --matrix-extra option, which adds additional
matrix dimensions. The option value format is:
haskell-ci adds all the combinations of GHC version and the
--matrix-extra
fields to the matrix. Corresponding build/test steps can beintroduced via
--github-patches
(or--travis-patches
).This commit implements this feature for GitHub actions only. It can be
implemented for Travis in a subsequent commit, if desired.