diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e27cadf4b..99300a356 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,10 @@ on: branches: [main] pull_request: +# The runner images are pinned to the platforms thirdshift supports. jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@stable @@ -17,5 +18,13 @@ jobs: - run: cargo fmt --check - run: cargo clippy --all-targets -- -D warnings # The tests run the binary against real git and fake gh and claude - # (Python scripts in tests/fakes), all present on ubuntu-latest. + # (Python scripts in tests/fakes), all present on the runner image. + - run: cargo test + + test-macos: + runs-on: macos-26 + steps: + - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 - run: cargo test diff --git a/tests/support/mod.rs b/tests/support/mod.rs index 684c1f6b8..3ceb21cc6 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -33,7 +33,11 @@ pub const OWNER: &str = "acme"; pub const REPO: &str = "widgets"; pub struct Scenario { - root: TempDir, + /// Deletes the temp root when the scenario is dropped. + _temp_dir: TempDir, + /// The temp root's path with symlinks resolved, as git reports it: on + /// macOS the temp directory is under `/var`, a symlink to `/private/var`. + root: PathBuf, } pub struct RunResult { @@ -56,8 +60,12 @@ impl Scenario { /// An origin with one commit on `main`, a launch clone of it with `main` /// checked out, and an open issue #7. pub fn new() -> Self { - let root = TempDir::new().unwrap(); - let scenario = Scenario { root }; + let temp_dir = TempDir::new().unwrap(); + let root = temp_dir.path().canonicalize().unwrap(); + let scenario = Scenario { + _temp_dir: temp_dir, + root, + }; for dir in ["home", "bin", "tmp", "work"] { fs::create_dir_all(scenario.path(dir)).unwrap(); } @@ -97,7 +105,7 @@ impl Scenario { } pub fn path(&self, relative: &str) -> PathBuf { - self.root.path().join(relative) + self.root.join(relative) } pub fn launch_dir(&self) -> PathBuf {