[New-bugs-announce] [issue40548] Always run GitHub action jobs, even on documentation-only jobs

STINNER Victor report at bugs.python.org
Thu May 7 13:39:37 EDT 2020


New submission from STINNER Victor <vstinner at python.org>:

bpo-39837 made Azure Pipelines CI non-mandatory. Travis CI was made mandatory to have at least one mandatory job: https://github.com/python/core-workflow/issues/365

I would prefer to have at least one mandatory Windows CI running on Python pull requests. Before we had pre-commit checks, it was too common to break Windows. I would prefer to not regress on that aspect.

--

Currently, GitHub action jobs ignore "documentation-only" changes. Extract of .github/workflows/build.yml:

on:
  push:
    branches:
    - master
    - 3.8
    - 3.7
    paths-ignore:
    - 'Doc/**'
    - 'Misc/**'
    - '**/*.md'
    - '**/*.rst'

If a job is marked as mandatory but the GitHub action is skipped because of paths-ignore, the PR cannot be merged :-( It seems to be a known GitHub limitation which is not going to be fixed soon:
https://discuss.python.org/t/make-one-windows-ci-job-mandatory/4047/6

To workaround is to always run GitHub action jobs, even on documentation-only jobs.

I propose to always run GitHub actions and then make the Windows (64 bit) job mandatory.

--

Sadly, it will waste resources for documentation-only jobs. To avoid that, the Windows job can be modified later to be skipped if it detects that the PR is a documentation-only change.

Steve Dower wrote:
"That workaround looks roughly like what is in the Azure Pipelines files. Someone just needs the time to go and migrate it."
https://discuss.python.org/t/make-one-windows-ci-job-mandatory/4047/6

Note: the Travis CI job (.travis.yml) uses the following check:

      # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
      # may include more changes than desired if the history is convoluted.
      # Instead, explicitly fetch the base branch and compare against the
      # merge-base commit.
      git fetch -q origin +refs/heads/$TRAVIS_BRANCH
      changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
      echo "Files changed:"
      echo "$changes"
      if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
      then
        echo "Only docs were updated, stopping build process."
        exit
      fi

--

More background on these CI issues:

* https://bugs.python.org/issue39837
* https://github.com/python/core-workflow/issues/365
* https://discuss.python.org/t/make-one-windows-ci-job-mandatory/4047

----------
components: Build
messages: 368357
nosy: vstinner
priority: normal
severity: normal
status: open
title: Always run GitHub action jobs, even on documentation-only jobs
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40548>
_______________________________________


More information about the New-bugs-announce mailing list