updating zenodo #17
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 | |
| # Runs the test suite, the local dry run, and the PyPI build flow on | |
| # every push to main and on every pull request. Three independent | |
| # jobs so a single failure surfaces in isolation. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # We only need to read the repo; no token writes. | |
| permissions: | |
| contents: read | |
| # Cancel an in-flight CI run for the same ref when a newer commit lands. | |
| # Saves runner time on rapid pushes without ever cancelling main. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| # ───────────────────────────────────────────────────────────────── | |
| # Full pytest suite across the supported Python versions. | |
| # ───────────────────────────────────────────────────────────────── | |
| tests: | |
| name: tests / py${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| defaults: | |
| run: | |
| working-directory: defaultplusplus | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: defaultplusplus/pyproject.toml | |
| # The HF test fixtures pull tiny models from | |
| # hf-internal-testing/.... Cache the resolved files between runs | |
| # so we only hit the network on miss. | |
| - name: Cache HuggingFace tokenizer / model fixtures | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/huggingface | |
| key: hf-cache-py${{ matrix.python-version }}-${{ hashFiles('defaultplusplus/tests/**/*.py') }} | |
| restore-keys: | | |
| hf-cache-py${{ matrix.python-version }}- | |
| hf-cache- | |
| - name: Install package + test extras | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[hf,dev]" | |
| - name: Run pytest | |
| env: | |
| # Matches the dev workflow so research-side ``src.data`` / | |
| # ``src.models`` imports resolve in the dry-run tests. | |
| PYTHONPATH: src | |
| # Disable HF telemetry / tokenizers parallelism warnings so | |
| # the test log stays focused on actual failures. | |
| HF_HUB_DISABLE_TELEMETRY: '1' | |
| TRANSFORMERS_NO_ADVISORY_WARNINGS: '1' | |
| TOKENIZERS_PARALLELISM: 'false' | |
| run: | | |
| pytest tests/ -q --maxfail=5 | |
| # ───────────────────────────────────────────────────────────────── | |
| # End-to-end smoke: imports + pytest dry-run + FPG sanity. | |
| # Quick mode (no GPU, no benchmark CSV needed). | |
| # ───────────────────────────────────────────────────────────────── | |
| dry-run: | |
| name: dry-run / py3.11 | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: defaultplusplus | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| cache-dependency-path: defaultplusplus/pyproject.toml | |
| - name: Cache HuggingFace fixtures | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/huggingface | |
| key: hf-cache-dryrun-${{ hashFiles('defaultplusplus/scripts/dry_run_local.sh') }} | |
| restore-keys: | | |
| hf-cache-dryrun- | |
| hf-cache- | |
| - name: Install package + test extras | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[hf,dev]" | |
| - name: Run scripts/dry_run_local.sh --quick | |
| env: | |
| PYTHONPATH: src | |
| HF_HUB_DISABLE_TELEMETRY: '1' | |
| TRANSFORMERS_NO_ADVISORY_WARNINGS: '1' | |
| TOKENIZERS_PARALLELISM: 'false' | |
| run: bash scripts/dry_run_local.sh --quick | |
| # ───────────────────────────────────────────────────────────────── | |
| # PyPI build flow. Verifies the package can produce sdist + wheel | |
| # and that twine check passes — never uploads. | |
| # ───────────────────────────────────────────────────────────────── | |
| build: | |
| name: build / sdist+wheel | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: defaultplusplus | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| - name: Build sdist + wheel and twine check | |
| run: bash scripts/build_pypi.sh | |
| - name: Verify dist/ contains exactly one sdist and one wheel | |
| run: | | |
| shopt -s nullglob | |
| sdists=(dist/*.tar.gz) | |
| wheels=(dist/*.whl) | |
| if [[ ${#sdists[@]} -ne 1 || ${#wheels[@]} -ne 1 ]]; then | |
| echo "expected one sdist + one wheel; got: ${sdists[*]} ${wheels[*]}" | |
| exit 1 | |
| fi | |
| echo "OK: ${sdists[*]} ${wheels[*]}" | |
| - name: Upload built artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-py3.11 | |
| path: defaultplusplus/dist/ | |
| retention-days: 7 | |
| if-no-files-found: error |