Merge branch 'main' of github.com:mfmanberg/CS506_Project #27
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: Testing | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| cache: 'pip' # Cache pip dependencies for faster builds | |
| - name: Install dependencies | |
| shell: powershell | |
| run: | | |
| if (Test-Path "requirements.txt") { | |
| pip install -r requirements.txt | |
| } else { | |
| Write-Host "No requirements.txt found, skipping..." | |
| } | |
| - name: Install Jupyter and dependencies | |
| run: | | |
| pip install jupyter nbconvert ipykernel | |
| python -m ipykernel install --user --name=python3 | |
| - name: Verify data files exist | |
| shell: powershell | |
| run: | | |
| Write-Host "Checking for parquet files..." | |
| $files = Get-ChildItem -Path "1_LIB/nyiso/nyiso_parquet" -Recurse -Filter "*.parquet" -ErrorAction SilentlyContinue | |
| if ($files) { | |
| Write-Host "Found $($files.Count) parquet file(s)" | |
| $files | Select-Object -First 5 | ForEach-Object { Write-Host " $($_.FullName)" } | |
| } else { | |
| Write-Host "WARNING: No parquet files found!" | |
| } | |
| - name: Run notebook | |
| run: | | |
| jupyter nbconvert --to notebook --execute 3_OUTPUT/3_svr/SVMDailywoutMeso.ipynb --inplace --ExecutePreprocessor.timeout=600 | |
| continue-on-error: true # Prevents workflow from failing if notebook has errors | |
| - name: Upload notebook output on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: notebook-output | |
| path: 3_OUTPUT/3_svr/SVMDailywoutMeso.ipynb | |
| - name: Check for execution errors | |
| shell: powershell | |
| run: | | |
| $notebook = Get-Content "3_OUTPUT/3_svr/SVMDailywoutMeso.ipynb" | ConvertFrom-Json | |
| $errors = $notebook.cells | Where-Object { $_.cell_type -eq "code" } | ForEach-Object { | |
| $_.outputs | Where-Object { $_.output_type -eq "error" } | |
| } | |
| if ($errors) { | |
| Write-Host "Notebook execution had errors:" | |
| $errors | ForEach-Object { Write-Host $_.evalue } | |
| exit 1 | |
| } else { | |
| Write-Host "Notebook executed successfully!" | |
| } |