Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CI tests on 3.12 and multiple operating systems #22

Merged
merged 9 commits into from
Jan 24, 2024

Commits on Sep 17, 2023

  1. Run CI test and lint on all branches

    This makes pushes trigger CI checks even when they are not to the
    main branch or in a PR opened against the main branch. This way,
    CI will work in forks once enabled in the Actions tab (otherwise
    the changes have to be on the "main" branch of the fork, or a PR
    is needed).
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    49666d6 View commit details
    Browse the repository at this point in the history
  2. Remove unused POETRY_VERSION env var in test.yml

    Unlike in the two other workflows, the test workflow specifies the
    poetry version with the poetry-version key in the poetry_setup
    action configuration.
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    f36d2fe View commit details
    Browse the repository at this point in the history
  3. Bump poetry used on CI from 1.4.2 to 1.6.1

    This includes performance improvements for installing, as detailed
    in https://python-poetry.org/history/#160---2023-08-20.
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    06bd8cf View commit details
    Browse the repository at this point in the history
  4. Quote shell expansions

    This is not really a bugfix, because it's possible to infer the
    correctness of the unquoted expansions in the cases where they
    appear in the CI workflows.
    
    However, quoting them makes the intent clear: we want the literal
    text produced by the expansion, and it is not intenteded that it be
    changed by word splitting and globbing (filename expansion) done by
    the shell.
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    ebc1f5d View commit details
    Browse the repository at this point in the history
  5. Test on Python 3.12 experimentally

    This allows a prerelease for 3.12, which is currently at RC2 so it
    will not install if a prerelease is not allowed, while continuing
    to prohibit installing a prerelease for earlier versions.
    
    Because 3.12 is at RC2, the likelihood of test failures on it due
    to bugs in 3.12 is fairly low. But in any situation where tests do
    fail on 3.12, it would be necessary to compare the reults to those
    of at least one other release, to rule this out. So I have also
    set continue-on-error to true for 3.12 so that failure of a 3.12
    job will not cancel the other jobs.
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    8639dfc View commit details
    Browse the repository at this point in the history
  6. Use automatically generated matrix job names

    Going along with this, to make it so good names are generated:
    
    - Change job key names from "build" to be descriptive/intuitive.
    
    - Capitalize workflow names to avoid confusion with the new job
      names, so workflow and job names are styled differently in CI
      output.
    
    This change may produce a minor improvement in clarity right now,
    but the real benefit is for the forthcoming expansion of the test
    matrix to include multiple operating systems, where the terser and
    more common style used to distinguish different generated jobs from
    the same matrix will be more readable. (Longer names produced from
    generated jobs are hard to distinguish because the full name would
    appear cut off in some places in the GitHub Actions web interface.)
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    aee13f7 View commit details
    Browse the repository at this point in the history
  7. Test on three major operating systems

    This extends the CI test matrix with an "os" dimension, so it tests
    on Ubuntu (as before), macOS, and Windows. It tests all five Python
    version on each, so the matrix now has 15 jobs.
    
    Building the value for "os" by appending "-latest" to names like
    "ubuntu", rather than just using the full names ("ubuntu-latest"),
    is less idiomatic. However, it helps keep the generated matrix job
    names narrow enough not to be cut off in the GitHub Actions
    interface, for matrices like this one that have a third dimension.
    (Currently, "core" is the only value for "test-type", but it is,
    and probably should, be kept in the names, thus lengthening them.)
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    836293f View commit details
    Browse the repository at this point in the history
  8. Install poetry with pip (not pipx) in test jobs

    This is imperfect, but it allows the correct version of Python
    to be installed and used with minimal complexity and special
    casing. Furthermore, because poetry is being used and the project
    is being installed in a virtual environment, polluting the global
    Python environment with poetry itself and its dependencies is
    unlikely to hide unstated dependency bugs or cause conflicts.
    
    On Ubuntu runners, pipx works with whatever version of Python is
    installed by setup-python, and commands like "python3.10" are
    available in $PATH for pipx to find and use. That is not the case
    on other GitHub Actions runners, however. This is especially a
    problem on Windows, where even obtaining the full path to the
    interpreter cannot be done in any straightforward portable way.
    (setup-python provides the Python directory in the pythonLocation
    Python_ROOT_DIR etc. environment variables, but where the Python
    interpeter is in it can differ by OS. This is practical, though
    cumbersome, to solve when only CPython is used. But if pypy is also
    used, which may be desired at some point in the future, then even
    more special-casing is required, on Windows.)
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    ff16cf6 View commit details
    Browse the repository at this point in the history
  9. Rename test_type to test-type

    Since kebab-case is more common than snake_case for this usage, and
    this convention was otherwise being used throughout the workflows.
    EliahKagan committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    b3b3d0a View commit details
    Browse the repository at this point in the history