diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index af7e04769..5a9e4989d 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -64,7 +64,12 @@ jobs: python3 scripts/test-workspace-concurrency.py python3 scripts/test-workspace-tests.py fi - cargo fmt --check + # One rustfmt call gets every source root of the workspace, which is longer than + # Windows allows for a command line (os error 206). rustfmt's result is the same on + # every system, so the Linux and macOS legs check it. + if [ "$RUNNER_OS" != Windows ]; then + cargo fmt --check + fi cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings command: | diff --git a/scripts/test-workspace-tests.py b/scripts/test-workspace-tests.py index 9572cac31..ac65da9c1 100644 --- a/scripts/test-workspace-tests.py +++ b/scripts/test-workspace-tests.py @@ -25,7 +25,9 @@ if [ "$RUNNER_OS" = Linux ]; then python3 scripts/test-workspace-concurrency.py python3 scripts/test-workspace-tests.py fi -cargo fmt --check +if [ "$RUNNER_OS" != Windows ]; then + cargo fmt --check +fi cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings """ @@ -96,11 +98,14 @@ TESTS = [ class WorkspaceTests(unittest.TestCase): def test_every_leg_lints_with_both_feature_sets(self): - for os_name in ("Linux", "macOS", "Windows"): + # Windows skips only rustfmt: one call with every source root of the workspace is longer + # than a Windows command line may be (os error 206), and Linux and macOS check the same + # formatting. + for os_name, expected in (("Linux", COMMON), ("macOS", COMMON), ("Windows", COMMON[1:])): with self.subTest(os=os_name): result = commands(os_name, name="lint-command") self.assertEqual(result.returncode, 0, result.stderr) - self.assertEqual(result.stdout.splitlines(), COMMON) + self.assertEqual(result.stdout.splitlines(), expected) def test_linux_and_macos_run_one_feature_set_with_doctests(self): for os_name in ("Linux", "macOS"):