Update extract_gtn_tutorials.py #470
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: Code Best Practices and Testing | |
| on: | |
| push: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'sources/bin/**' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install tox | |
| run: python -m pip install 'tox>=1.8.0' | |
| - name: Lint | |
| run: tox -e lint | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: python -m pip install -r requirements.txt | |
| - name: Run tests and measure coverage | |
| working-directory: sources | |
| run: | | |
| PYTHONPATH=bin coverage run -m unittest discover -s bin/tests -v | |
| - name: Print coverage report | |
| working-directory: sources | |
| run: coverage report | |
| - name: Generate HTML coverage report | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| working-directory: sources | |
| run: coverage html | |
| - name: Upload coverage HTML report | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: coverage-html | |
| path: sources/htmlcov # Use full path relative to root |