I'm new to GitHub Actions (and continuous integration in general). I was just reading Using Node.js with GitHub Actions and I found this snippet there from the Node.js workflow template:
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
It's mentioned that
The template includes a matrix strategy that builds and tests your code with three Node.js versions: 8.x, 10.x, and 12.x. The 'x' is a wildcard character that matches the latest minor and patch release available for a version. Each version of Node.js specified in the
node-versionarray creates a job that runs the same steps.
My question is — why build and test with different Node versions? Why not just use one version?
Thank you!