@@ -59,13 +59,35 @@ jobs:
5959 - name : Install pooch (needed by conftest)
6060 run : python -m pip install pooch
6161
62+ - name : Start memory monitor
63+ shell : bash
64+ run : |
65+ mkdir -p ci_monitor
66+ nohup bash .ci_helpers/memory_usage/monitor_memory_linux.sh >/dev/null 2>&1 &
67+ echo $! > ci_monitor/monitor.pid
68+
6269 - name : Run unit tests
6370 run : |
6471 pytest -m unit -vvv -rx --numprocesses=auto \
6572 --cov=echopype --cov-report=xml --log-cli-level=WARNING --disable-warnings
6673
74+ - name : Stop memory monitor
75+ if : always()
76+ shell : bash
77+ run : |
78+ if [ -f ci_monitor/monitor.pid ]; then
79+ kill "$(cat ci_monitor/monitor.pid)" || true
80+ fi
81+
82+ - name : Upload memory CSV
83+ if : always()
84+ uses : actions/upload-artifact@v7
85+ with :
86+ name : memory-unit-${{ matrix.python-version }}-${{ matrix.runs-on }}
87+ path : ci_monitor/memory_usage.csv
88+
6789 - name : Upload code coverage to Codecov
68- uses : codecov/codecov-action@v5
90+ uses : codecov/codecov-action@v6
6991 with :
7092 files : ./coverage.xml
7193 flags : unit
@@ -191,13 +213,35 @@ jobs:
191213 du -h -d 3 ${{ env.XDG_CACHE_HOME }} || true
192214 docker system df || true
193215
216+ - name : Start memory monitor
217+ shell : bash
218+ run : |
219+ mkdir -p ci_monitor
220+ nohup bash .ci_helpers/memory_usage/monitor_memory_linux.sh >/dev/null 2>&1 &
221+ echo $! > ci_monitor/monitor.pid
222+
194223 - name : Running integration tests
195224 run : |
196225 pytest -m integration -vvv -rx --numprocesses=${{ env.NUM_WORKERS }} --max-worker-restart=3 \
197226 --cov=echopype --cov-report=xml --log-cli-level=WARNING --disable-warnings
198227
228+ - name : Stop memory monitor
229+ if : always()
230+ shell : bash
231+ run : |
232+ if [ -f ci_monitor/monitor.pid ]; then
233+ kill "$(cat ci_monitor/monitor.pid)" || true
234+ fi
235+
236+ - name : Upload memory CSV
237+ if : always()
238+ uses : actions/upload-artifact@v7
239+ with :
240+ name : memory-integration-${{ matrix.python-version }}-${{ matrix.runs-on }}
241+ path : ci_monitor/memory_usage.csv
242+
199243 - name : Upload code coverage to Codecov
200- uses : codecov/codecov-action@v5
244+ uses : codecov/codecov-action@v6
201245 with :
202246 files : ./coverage.xml
203247 flags : integration
@@ -245,6 +289,13 @@ jobs:
245289 - name : Start local services
246290 run : python .ci_helpers/setup-services-windows.py start
247291
292+ - name : Start memory monitor
293+ shell : pwsh
294+ run : |
295+ New-Item -ItemType Directory -Force -Path ci_monitor | Out-Null
296+ $p = Start-Process pwsh -ArgumentList "-File", ".ci_helpers/memory_usage/monitor_memory_windows.ps1" -PassThru -WindowStyle Hidden
297+ $p.Id | Out-File ci_monitor/monitor.pid -Encoding ascii
298+
248299 - name : Running all tests
249300 shell : pwsh
250301 env :
@@ -255,8 +306,24 @@ jobs:
255306 --cov echopype --cov-report xml
256307 --log-cli-level WARNING --disable-warnings
257308
309+ - name : Stop memory monitor
310+ if : always()
311+ shell : pwsh
312+ run : |
313+ if (Test-Path ci_monitor/monitor.pid) {
314+ $monitorPid = Get-Content ci_monitor/monitor.pid
315+ Stop-Process -Id $monitorPid -Force -ErrorAction SilentlyContinue
316+ }
317+
318+ - name : Upload memory CSV
319+ if : always()
320+ uses : actions/upload-artifact@v7
321+ with :
322+ name : memory-windows-${{ matrix.python-version }}
323+ path : ci_monitor/memory_usage.csv
324+
258325 - name : Upload code coverage
259- uses : codecov/codecov-action@v5
326+ uses : codecov/codecov-action@v6
260327 with :
261328 files : ./coverage.xml
262329 flags : unittests
@@ -267,3 +334,29 @@ jobs:
267334 - name : Teardown services
268335 if : always()
269336 run : python .ci_helpers/setup-services-windows.py stop
337+
338+ memory-summary :
339+ name : memory-summary
340+ runs-on : ubuntu-latest
341+ needs : [unit-tests, integration-tests, test-windows]
342+ if : always()
343+
344+ steps :
345+ - uses : actions/checkout@v6
346+
347+ - name : Download all memory artifacts
348+ uses : actions/download-artifact@v8
349+ with :
350+ path : memory_artifacts
351+
352+ - name : Install matplotlib
353+ run : python -m pip install matplotlib
354+
355+ - name : Build memory summary
356+ run : python .ci_helpers/memory_usage/build_memory_summary.py
357+
358+ - name : Upload combined memory plot
359+ uses : actions/upload-artifact@v7
360+ with :
361+ name : memory-summary
362+ path : memory_all_jobs.png
0 commit comments