style: apply ruff formatting after merge of PR #112 #11
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: | |
| branches: [master] | |
| paths: | |
| - "fdsreader/**" | |
| - "tests/**" | |
| - "pyproject.toml" | |
| - "docs/**" | |
| - ".readthedocs.yaml" | |
| - ".github/workflows/ci.yml" | |
| pull_request: | |
| paths: | |
| - "fdsreader/**" | |
| - "tests/**" | |
| - "pyproject.toml" | |
| - "docs/**" | |
| - ".readthedocs.yaml" | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| docs: ${{ steps.filter.outputs.docs }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - "fdsreader/**" | |
| - "tests/**" | |
| - "pyproject.toml" | |
| docs: | |
| - "docs/**" | |
| - ".readthedocs.yaml" | |
| lint: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install ruff | |
| - run: ruff check fdsreader/ | |
| - run: ruff format --check fdsreader/ | |
| test: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Prepare test cases | |
| run: cd tests/cases && for f in *.tgz; do tar -xzvf "$f"; done | |
| - name: Run tests | |
| run: pytest tests/ --cov=fdsreader --cov-report=xml --cov-report=term-missing | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.12' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.xml | |
| docs-build: | |
| needs: changes | |
| if: needs.changes.outputs.docs == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install -e ".[docs]" | |
| - name: Build docs | |
| run: sphinx-build --keep-going -b html docs/ docs/_build/html |