Use artifacts from previous builds instead of rebuilding when code has not changed

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

Our pipelines spend a lot of time doing things that don't need doing. We have a number of unnecessary build jobs that stem from pipelines triggered by changes that are not in the source code that would generate the necessary artifact for the remaining jobs to run.

Proposal

Create a configuration to only run build jobs that produce artifacts that are out of date with respect to their source code. If the source code hasn't changed, the previously-built artifact is used.

Ideally, GitLab would be able to automatically determine artifact dependencies, and only rebuild things whose code has changed.

Similar to this issue, except depending on the commit SHA instead of on an explicit list of files.

Edited by 🤖 GitLab Bot 🤖