Use matrix setup in our workflow to test features#420
Conversation
| - if: ${{ matrix.layout == 'none' && matrix.feature == 'none' }} | ||
| run: | | ||
| cargo build --no-default-features | ||
| cargo test --no-default-features | ||
| - if: ${{ matrix.layout != 'none' && matrix.feature == 'none' }} | ||
| run: | | ||
| cargo build --no-default-features --features ${{ matrix.layout }} | ||
| cargo test --no-default-features --features ${{ matrix.layout }} | ||
| - if: ${{ matrix.layout == 'none' && matrix.feature != 'none' }} | ||
| run: | | ||
| cargo build --no-default-features --features ${{ matrix.feature }} | ||
| cargo test --no-default-features --features ${{ matrix.feature }} | ||
| - if: ${{ matrix.layout != 'none' && matrix.feature != 'none' }} | ||
| run: | | ||
| cargo build --no-default-features --features ${{ matrix.layout }},${{ matrix.feature }} | ||
| cargo test --no-default-features --features ${{ matrix.layout }},${{ matrix.feature }} |
There was a problem hiding this comment.
I find all this branching a bit clunky but it was the only way I've found so far to be able to specify "nothing". Maybe we don't need to test things like --no-default-features --features alloc?
If we remove the idea of testing for no layout feature together with optional, and extract cargo test --no-default-features as a separate job, we can remove all this branching.
There was a problem hiding this comment.
I think the serde feature is possibly the one that ought to be pulled out into it's own job(s). I think alloc definitely needs to be tested. If anything it's the combinations that don't have either std or alloc that we could drop if want. I'm not sure how much sense it really makes to use Taffy in an environment without allocation.
There was a problem hiding this comment.
I've put the allocation features: std & alloc into its own axis in the matrix. It will now always test with either of them.
I've also extracted cargo test --no-default-features into its own job.
Let me know what you think of the current setup
0eef16f to
35f1ad8
Compare
Objective
Note: This builds from #414 so this should be merged after that one.
As taffy grows in scope and we add more layouting algorithms that each has their own feature flags, maintaining the full set of features that needed to be tested together is going to be harder to keep track of and maintain manually.
This change proposes to start using github actions' matrix setup in order to more easily grow and maintain the number of features we have.
It includes the following:
Feedback wanted