chore: use dependency groups (#550) #1276
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - uses: astral-sh/setup-uv@v7 | |
| - uses: pre-commit/action@v3.0.1 | |
| with: | |
| extra_args: --all-files --hook-stage manual | |
| - name: PyLint | |
| run: uvx nox -s pylint -- --output-format=github | |
| checks: | |
| name: Check ${{ matrix.os }} Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ['3.10', '3.12', '3.14'] | |
| include: | |
| - {os: macos-15-intel, python-version: '3.10'} | |
| - {os: macos-latest, python-version: '3.14'} | |
| - {os: windows-latest, python-version: '3.11'} | |
| - {os: windows-latest, python-version: '3.13'} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Install package | |
| run: uv pip install --system -e. --group=test | |
| - name: Pytest | |
| if: runner.os == 'Linux' | |
| run: python -m pip install pytest-github-actions-annotate-failures | |
| - name: Test package | |
| run: python -m pytest ./tests --cov=src/decaylanguage --cov-report=xml | |
| - name: Test coverage with Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Test docstrings with doctest | |
| if: "runner.os == 'Linux' && matrix.python-version == 3.12" | |
| run: python -m pytest --doctest-modules src/decaylanguage | |
| notebooks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Install dot | |
| run: sudo apt-get install graphviz | |
| - name: Install package | |
| run: uv pip install --system -e. --group=test | |
| - name: Install notebook requirements | |
| run: uv pip install --system nbconvert jupyter_client ipykernel pydot | |
| - name: Run the notebooks inplace | |
| run: jupyter nbconvert --execute --inplace notebooks/DecayLanguageDemo.ipynb notebooks/ExampleDecFileParsingWithLark.ipynb |