Running multiple permutations (of variable combinations) of a pipeline *not* in parallel

I have my own gitlab repo server, as well as a windows gitlab runner configured. The runner isn’t very powerful, and any notion of “running multiple jobs at the same time” on this single runner would be bad for performance.

I’ve already looked into the “parallel” option (with matrix), and quote “Use parallel:matrix to run a job multiple times in parallel in a single pipeline, but with different variable values for each instance of the job” sounds exactly like what I need, but it doesn’t look like I can do that because I need an amount of runners equal to the jobs I have, which I don’t (if possible, a plausible solution for me would be for these “alternate parallel tasks” to be deferred and taken care of one-at-a-time on my single runner, but I see no mention of this functionality).

For the record, I would like to accomplish a solution that puts as much work in the yml, and as little work into logic within the shell script. Ideally the shell script should “just do the job, and not have to meta-manage these ‘permutation’ jobs”. I asked chatgpt, and it recommended, I have some nested for loops within the shell script that iterated over variable options, and re-call the body for each one.

Here’s a simplified version of my gitlab-ci.yml:

variables:
  VAR_A:
    value: "A"
    options:
      - "A"
      - "B"
  VAR_B:
    value: "1"
    options:
      - "1"
      - "2"

some-job:
  script: #some job that uses the variables "VAR_A" and "VAR_B"
    - ...

I would like the job “some-job” to run individually, not in parallel, for some and/or all permutations for the options for both variables, e.g., run the job with VAR_A=A, VAR_B=1 and VAR_A=B, VAR_B=1 and VAR_A=A, VAR_B=2 and VAR_A=B, VAR_B=2.

This functionality seems like a common enough desire based on my googling, but I’ve yet to find what I’m looking for. I saw one post on this forum mention something about “child jobs”, but I don’t really see what that would have to do with this topic.

I’m looking to accomplish this without jobs running in parallel. Bonus points for a solution that allows me to choose a subset of these permutations, so that I don’t necessarily have to run a manually specified set of permutations (if I so desire). Extra bonus points if I don’t have to manually re-specify the “options” for these variables a second time, I’d rather not have to define the variable options in multiple places, so that if I add/remove any, I don’t have to do it twice and potentially forget.

Thank you for your time!