Update python-test.yml #2
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: Python Test and Artifact Upload | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] # Test on a few Python versions | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install pytest # Ensure pytest is installed even if not in requirements for some reason | |
| - name: Test with pytest | |
| run: | | |
| pytest test_freetse_integration.py | |
| - name: Upload test outputs | |
| if: always() # Always run this step to upload artifacts, even if tests fail, to help debugging | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: test-outputs-python-${{ matrix.python-version }} | |
| path: test_output/ | |
| retention-days: 7 # Keep artifacts for 7 days |