Bump websocket-driver from 0.7.4 to 0.7.5 in /website #1576
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: CI | |
| on: | |
| push: | |
| pull_request: | |
| branches: [ main ] | |
| # Permissions needed for GitHub Pages deployment | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install flake8 | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8==7.3.0 flake8-bugbear>=24.0.0 | |
| - name: Run flake8 | |
| run: | | |
| flake8 src/ | |
| test: | |
| runs-on: 4-core-ubuntu | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run pytest | |
| run: | | |
| pytest src/mcgrad/tests/ -v | |
| - name: Generate coverage report | |
| run: | | |
| pytest src/mcgrad/tests/ --cov=src/mcgrad --cov-report=term --cov-report=html --cov-report=xml | |
| continue-on-error: true | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| if: matrix.python-version == '3.11' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| flags: unittests | |
| name: codecov-mcgrad | |
| fail_ci_if_error: true | |
| verbose: true | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-report-${{ matrix.python-version }} | |
| path: | | |
| htmlcov/ | |
| coverage.xml | |
| retention-days: 30 | |
| # Build Sphinx API documentation first | |
| sphinx: | |
| runs-on: 4-core-ubuntu | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-sphinx-${{ hashFiles('sphinx/requirements.txt', 'pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-sphinx- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install -r sphinx/requirements.txt | |
| - name: Build Sphinx documentation | |
| working-directory: ./sphinx | |
| run: | | |
| sphinx-build -b html source build/html | |
| - name: Upload Sphinx artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sphinx-docs | |
| path: sphinx/build/html/ | |
| retention-days: 1 | |
| # Build Docusaurus website and merge Sphinx docs | |
| docs: | |
| runs-on: ubuntu-latest | |
| needs: sphinx | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: website/package-lock.json | |
| - name: Download Sphinx docs | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sphinx-docs | |
| # Place Sphinx docs in static/reference folder | |
| # Docusaurus copies static files to build root | |
| path: website/static/reference | |
| - name: Install dependencies | |
| working-directory: ./website | |
| run: npm ci | |
| - name: Build website | |
| working-directory: ./website | |
| run: npm run build | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: website/build/ | |
| # Deploy combined site to GitHub Pages | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: docs | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |