File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Run K-Wave Examples
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 0 * * 1' # Every Monday at 00:00 UTC
6+ workflow_dispatch : # Manual trigger
7+
8+ jobs :
9+ discover-examples :
10+ runs-on : ubuntu-latest
11+ outputs :
12+ example_paths : ${{ steps.find-examples.outputs.examples }}
13+ steps :
14+ - uses : actions/checkout@v4
15+ - id : find-examples
16+ run : |
17+ # Find all Python files in examples subdirectories
18+ EXAMPLES=$(find examples -name "*.py" -not -path "*/\.*" | jq -R -s -c 'split("\n")[:-1]')
19+ echo "examples=$EXAMPLES" >> "$GITHUB_OUTPUT"
20+
21+ run-examples :
22+ needs : discover-examples
23+ runs-on : ubuntu-latest
24+ timeout-minutes : 60 # 1 hour timeout per example
25+ strategy :
26+ fail-fast : false # Continue running other examples even if one fails
27+ matrix :
28+ example : ${{ fromJson(needs.discover-examples.outputs.example_paths) }}
29+
30+ steps :
31+ - name : Checkout repository
32+ uses : actions/checkout@v4
33+
34+ - name : Set up Python
35+ uses : actions/setup-python@v5
36+ with :
37+ python-version : ' 3.10' # Matches requires-python from pyproject.toml
38+ cache : ' pip'
39+
40+ - name : Install dependencies
41+ run : |
42+ python -m pip install --upgrade pip
43+ # Install the package with example dependencies
44+ pip install -e ".[example]"
45+
46+ - name : Run example
47+ env :
48+ KWAVE_FORCE_CPU : 1
49+ run : |
50+ echo "Running example: ${{ matrix.example }}"
51+ python "${{ matrix.example }}"
Original file line number Diff line number Diff line change 1- import pytest
21import numpy as np
32
43from kwave .utils .mapgen import create_pixel_dim
You can’t perform that action at this time.
0 commit comments