awslabs / tough

Rust libraries and tools for using and generating TUF repositories
191 stars 45 forks source link

Enable windows and macos builds in CI #660

Closed cbgbt closed 11 months ago

cbgbt commented 11 months ago

Issue #, if available: Closes: #349 Closes: #347 Closes: #663

Description of changes:

    github: run CI on windows

    This also disables Rust incremental builds in the CI for a few reasons:
    * Incremental builds need a lot of disk space, which we need to protect
      for Windows builds.
    * Only the first invocation for each cache key is stored, so the delta
      between incremental builds grows larger over time.

    See https://github.com/dtolnay/rust-toolchain/issues/26 for more
    details.
    tough: always use unix-style paths in clean_name

    Using `std::path::Path` to manipulate `Url` paths only has the correct
    behavior on unix systems where the properties of the paths are nearly
    identical.

    This change moves to using unix-style path manipulation regardless of
    platform.

    It also adds a utility for safely creating filesystem paths based on
    `Url` paths for both unix and windows (which is complicated by drive
    lettering in absolute paths).
    Refrain from using docker for integration testing

    Github actions on Windows do not allow running Linux containers. In
    order to run the same CI on Windows as Linux, we compile toxic HTTP
    services at test time.
    github: run CI on macos
    integ: use retries when applying toxics

    The forked noxious-server takes a little longer to start on MacOS. Using
    retries ensures we keep trying until the server is ready.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

cbgbt commented 11 months ago

Thanks @chipsenkbeil for help with https://github.com/chipsenkbeil/typed-path/issues/8, which made this much easier than it could have been.