Explorer UX + CI Improvements #297
Workflow file for this run
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
| # GitHub Actions workflow for running unit tests | |
| # Runs on pull requests and nightly | |
| name: Tests | |
| # Cancel obsolete runs on rapid pushes. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| schedule: | |
| # Run nightly at 2:00 AM UTC | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.11', '3.12'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }}- | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run unit tests with pytest | |
| run: | | |
| python -m pytest test/ -v --tb=short --cov=boxcrete --cov-report=xml --cov-report=term-missing --cov-fail-under=100 | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4 — pinned to commit SHA per CodeQL: 3rd-party action | |
| if: matrix.python-version == '3.12' | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install linting dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install dev extras so `black` is pinned to the version in | |
| # pyproject.toml. Keep this in sync with .pre-commit-config.yaml | |
| # and the local `make lint` target. | |
| pip install -e ".[dev]" | |
| - name: Check code formatting with black | |
| run: | | |
| black --check --diff . | |
| - name: Lint with flake8 | |
| run: | | |
| # Hard gate: syntax errors, undefined names, unused imports / | |
| # locals (real bugs), AND style violations (long lines, | |
| # whitespace, etc.) — keeping local pre-commit and CI in sync | |
| # so 'green locally' implies 'green on CI'. | |
| flake8 . --count --select=E9,E202,E226,E251,E402,E501,E741,F401,F63,F7,F811,F82,F841 --show-source --statistics | |
| # Exit-zero treats remaining E/W warnings as informational. | |
| flake8 . --count --exit-zero --statistics |