Skip to content

Commit 06329a6

Browse files
committed
CI: Lower cost/run to 40% of original cost
...mostly by reducing the number of macOS runners (43 x Linux) -> (17 x Linux) [40% of original cost]
1 parent a5c6600 commit 06329a6

File tree

4 files changed

+40
-28
lines changed

4 files changed

+40
-28
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
- 'x86_64'
2929
# NOTE: Required for building the distribution artifact
3030
- 'universal2'
31+
run_macos_asan_tests:
32+
description: 'Run macOS Address Sanitizer tests'
33+
required: false
34+
default: false
35+
type: boolean
3136
show_notarization_log:
3237
description: 'Show notarization log for macOS'
3338
required: false
@@ -49,10 +54,13 @@ env:
4954
# because segfaults more common on macOS
5055
jobs:
5156

57+
# CAUTION: macOS runners cost 10x a Linux runner and 5x a Windows runner.
58+
# Keep the matrix small to avoid high costs.
5259
build-macos-asan:
60+
# Only run this expensive job when explicitly requested or when building distribution artifacts
61+
if: ${{ github.event.inputs.run_macos_asan_tests == 'true' || github.event.inputs.build_dist_artifact == 'true' }}
5362
strategy:
5463
matrix:
55-
# NOTE: Test lots of Python versions to look for segfaults
5664
python-version:
5765
- "3.11.9"
5866
fail-fast: false
@@ -125,6 +133,8 @@ jobs:
125133
run: |
126134
crystal --test ${TEST_NAMES}
127135
136+
# CAUTION: macOS runners cost 10x a Linux runner and 5x a Windows runner.
137+
# Keep the matrix small to avoid high costs.
128138
build-macos:
129139
strategy:
130140
matrix:
@@ -136,16 +146,7 @@ jobs:
136146
#- macos-15 # ARM-based
137147
# Test the earliest supported Python version only
138148
python-version:
139-
# Test earliest to latest Python versions supported by Crystal,
140-
# on at least one OS.
141-
#
142-
# NOTE: Testing all Python versions on Linux would be faster
143-
# than on macOS because Linux runners are faster than
144-
# every other OS. However macOS is the second fastest OS,
145-
# and doesn't require precompiled wxPython .wgn files.
146149
- "3.11.9"
147-
- "3.12.9"
148-
- "3.13.5"
149150
fail-fast: false
150151
runs-on: ${{ matrix.os }}
151152
timeout-minutes: 31 # 150% of normal time: 21 min, as of 2025-07-21
@@ -465,7 +466,16 @@ jobs:
465466
# NOTE: Earliest Windows supported by Crystal is Windows 11 (from the README)
466467
- windows-2025 # based on Windows 11 version 24H2 (Germanium)
467468
python-version:
469+
# Test earliest to latest Python versions supported by Crystal,
470+
# on at least one OS.
471+
#
472+
# NOTE: Testing all Python versions on Linux would be faster
473+
# than on Windows because Linux runners are faster than
474+
# every other OS. However Windows is the second fastest OS,
475+
# and doesn't require precompiled wxPython .wgn files.
468476
- "3.11.9"
477+
- "3.12.9"
478+
- "3.13.5"
469479
fail-fast: false
470480
runs-on: ${{ matrix.os }}
471481
timeout-minutes: 43 # 150% of normal time: 29 min, as of 2025-07-21

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ and new `--port`/`--host` options for controlling how projects are served.
6464
* Development improvements
6565
* GitHub Copilot Agent now has a comprehensive set of AI instructions
6666
to refer to when making autonomous changes to Crystal.
67+
* Decrease average cost of CI runs by running fewer macOS jobs by default.
6768

6869
### v1.10.0 (June 21, 2025)
6970

poetry.lock

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ order_by_type = false # don't sort constants specially
5757
crystal = 'crystal.__main__:main'
5858

5959
[tool.poetry.dependencies]
60-
# NOTE: Python 3.11 is the latest Python supported by py2exe 0.13.0.2
60+
# NOTE: Python 3.13 is the latest Python supported by py2exe 0.14.0.0
6161
python = ">=3.11,<3.14"
6262
# NOTE: When changing the version of wxPython to Y, you'll need to make sure
6363
# there is a precompiled wheel for {Python 3.X, wxPython Y, OS}
@@ -69,9 +69,8 @@ python = ">=3.11,<3.14"
6969
wxPython = "4.2.3"
7070
beautifulsoup4 = "^4.9.3"
7171
py2app = { version = "^0.28", markers = "sys_platform == 'darwin'" }
72-
# NOTE: py2exe 0.13.0.2 only supports Python 3.11, so we use a marker to
73-
# ensure it is only installed on Windows with Python 3.11.
74-
py2exe = { version = "^0.13.0.2", markers = "sys_platform == 'win32' and python_version >= '3.11' and python_version < '3.12'" }
72+
# NOTE: py2exe 0.14.0.0 supports Python 3.11, 3.12, and 3.13.
73+
py2exe = { version = "^0.14.0.0", markers = "sys_platform == 'win32' and python_version >= '3.11'" }
7574
tinycss2 = "^1.1.0"
7675
appdirs = "^1.4.4"
7776
colorama = "^0.4.4"

0 commit comments

Comments
 (0)