Refactors BB dataset, eva + grading scripts #85
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: Lint and Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Run pre-commit | |
| uses: pre-commit/[email protected] | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff pytest pytest-asyncio numpy setuptools>=66 wheel>=0.36 build | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f pyproject.toml ]; then pip install -e .; fi | |
| - name: Run Test | |
| run: | | |
| python -m pytest | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install linting tools from pre-commit config | |
| pip install ruff black codespell toml-sort validate-pyproject-schema-store blacken-docs | |
| # Install project dependencies | |
| pip install pytest numpy setuptools>=66 wheel>=0.36 build | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f pyproject.toml ]; then pip install -e .; fi | |
| - name: Run Ruff (linting) | |
| run: | | |
| # Check for linting issues (matching pre-commit args) | |
| ruff check . --fix --exit-non-zero-on-fix | |
| - name: Run Black (formatting) | |
| run: | | |
| # Check for formatting issues | |
| black --check . | |
| - name: Check TOML files | |
| run: | | |
| # Check and sort TOML files | |
| find . -name "*.toml" -type f -exec toml-sort --check {} \; | |
| - name: Run Blacken-docs | |
| run: | | |
| # Check Python code blocks in documentation | |
| blacken-docs --check **/*.md **/*.rst || true # Allow failure for now |