Add pre-commit hooks, excluding the binary test fixtures #138
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: PyTest & Ruff | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install -qq libsnappy-dev | |
| python -m pip install --upgrade pip | |
| pip install "ruff==0.16.2" pytest rich | |
| pip install -r requirements.txt | |
| - name: Build gencode | |
| # protoc is pinned and downloaded by dumper/run.py itself, so CI and local | |
| # builds produce identical generated code. | |
| run: PYTHONPATH=$PYTHONPATH:$(pwd) python3 dumper/run.py | |
| - name: Lint with ruff | |
| run: ruff check . | |
| - name: Test with pytest | |
| run: PYTHONPATH=$PYTHONPATH:$(pwd) pytest |