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

Make GitHub pipeline run tests on multiple node versions #3499

Open
5 tasks done
giseburt opened this issue Mar 30, 2024 · 0 comments · May be fixed by #3500
Open
5 tasks done

Make GitHub pipeline run tests on multiple node versions #3499

giseburt opened this issue Mar 30, 2024 · 0 comments · May be fixed by #3500
Labels
enhancement New feature or request

Comments

@giseburt
Copy link
Contributor

giseburt commented Mar 30, 2024

This comes from the discussion on #3447, where (in that case) been able to build with different combinations of node and ESM would be useful.

The concept being to use jobs.<job_id>.strategy.matrix int he GitHub workflows as outlined here: Using a matrix for your jobs

This is a generic capability projen projects should be able to utilize as well, and there's already partial support for in place.

I'm working on a PR for this, and it turns out it's not as well supported as it at first appears.

Issue's I've encountered (so far, checked means I'm past that in my in-progress PR):

  • BuildWorkflow doesn't expose a way to set the strategy in it's options, and there's no mechanism (outside of an escape-hatch) to set it later
  • NodeProject doesn't expose a way to set the strategy of the build workflow
    • I've added it as buildWorkflowJobStrategy to match buildWorkflowTriggers etc.
    • This only covers build workflow, what if we want workflow matrices for other jobs such as release? I'd assume they wouldn't be the same matrix
  • JobMatrixValue doesn't support objects
    • Docs linked to above say:

      A variable configuration in a matrix can be an array of objects.

    • It's unclear if that means it can be arbitrarily deep objects, so I'm going with a two-level
  • For node version I've added buildWorkflowNodeVersion and wired it up to override node version in the workflow setup for the build workflow
  • We build and test in the same step, and then release an artifact from that build. We either need a mechanism to choose which build is the one that's released or we need to separate build and test
    • Closely related, we probably don't need or want "Upload coverage to Codecov" on every node of the matrix
    • Update: Added ability to set a variable to control that additional steps

I'm stopped on that last part, and am open to suggestions. For now, I'm going to add a property with node 18.14.2 (current one being used to release) that I'll have it add if statements to the final "Backup artifact permissions" and "Upload artifact" steps.

I'll update when I have a branch pushed to review.

Update: PR in #3500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants