Skip to content

GitHub Actions don't build exactly the pushed commit #14061

Open
@hahnjo

Description

@hahnjo

At the moment, push workflows pass --base_ref master to build_root.py. This means that they may actually pick up a later commit (= the current commit on the branch) at the time the job actually starts to run. In order to be usable as indications when a certain configuration broke, it would be more useful to test exactly the pushed commit, identified by its hash.

Unfortunately, fixing this isn't as easy as replacing

- name: Update build cache after push to release branch
if: github.event_name == 'push'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype RelWithDebInfo
--platform ${{ matrix.image }}
--incremental false
--base_ref ${{ github.ref_name }}
--binaries ${{ startsWith(github.ref, 'refs/tags/') }}
--repository ${{ github.server_url }}/${{ github.repository }}
"

to pass --base_ref ${{ github.sha }} because build_root.py calls git clone --branch {branch} --single-branch {repository}. Passing a hash here doesn't work (in local tests), and would otherwise probably result in a detached HEAD. Another complication is that the sources are included in the build artifacts used by PR builds, so they have to look like an ordinary clone for the rebase operation to work.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions