Skip jobs based on outcome of earlier jobs in pipeline

I have a pipeline set up as follows:
Artifacts-fetching → building → testing

The test phase includes testing on physical hardware and depending on the built software, different hardware should be tested. The testing-part contains several test jobs that are associated with the different types of hardware. If I knew the type of software that were to be tested before the execution of the pipeline, I could just use the “rules” keyword, and it would be perfect. The problem is that I don’t have this information until the building stage has completed.

What I want to know:
Is there a way to do a conditional skip of a job based on environment variables generated in previous jobs in the same pipeline? Or is there any other way that might solve this problem better?

In advance, thank you.

The solution seems to be this for me parent/child pipelines: Parent-child pipelines | GitLab. My solution were to generate a new .yml file based on the results of the previous jobs and trigger it as a child pipeline.