Run K-Wave Examples #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run K-Wave Examples | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1' # Every Monday at 00:00 UTC | |
| workflow_dispatch: # Manual trigger | |
| jobs: | |
| discover-examples: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| example_paths: ${{ steps.find-examples.outputs.examples }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: find-examples | |
| run: | | |
| # Find all Python files in examples subdirectories | |
| EXAMPLES=$(find examples -name "*.py" -not -path "*/\.*" | jq -R -s -c 'split("\n")[:-1]') | |
| echo "examples=$EXAMPLES" >> "$GITHUB_OUTPUT" | |
| run-examples: | |
| needs: discover-examples | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 # 1 hour timeout per example | |
| strategy: | |
| fail-fast: false # Continue running other examples even if one fails | |
| matrix: | |
| example: ${{ fromJson(needs.discover-examples.outputs.example_paths) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ffmpeg | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' # Matches requires-python from pyproject.toml | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install the package with example dependencies | |
| pip install -e ".[example]" | |
| - name: Run example | |
| env: | |
| KWAVE_FORCE_CPU: 1 | |
| run: | | |
| echo "Running example: ${{ matrix.example }}" | |
| python "${{ matrix.example }}" |