Updates to distributed training and docs #1656
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 Package using Mamba | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| actions: write | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| statuses: write | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
| pip install . | |
| pip install ruff pytest pytest-cov | |
| - name: Lint with ruff | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| ruff check --select=E9,F63,F7,F82 --exit-zero | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| ruff check --output-format concise --exit-zero | |
| # Checking documentation errors | |
| ruff check --select=D --exit-zero --statistics | |
| - name: Test with pytest | |
| run: | | |
| pytest | |
| - name: Pytest Coverage | |
| run: | | |
| pytest --cov=credit --cov-branch --cov-report=xml | |
| # pytest --cov=credit tests/ | tee pytest-coverage.txt | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| #- name: Pytest coverage comment | |
| # uses: MishaKav/pytest-coverage-comment@1bdbba85fb74a2fdc1ec66383acec1091610f82b # v1.1.57 | |
| # if: ${{ !github.event.pull_request.head.repo.fork }} | |
| # with: | |
| # pytest-coverage-path: ./pytest-coverage.txt | |