try fixing coverage issues #6
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: | |
push: | |
paths-ignore: | |
- "*.md" | |
# Cancel in-progress jobs when pushing to the same branch. | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
build: | |
env: | |
UV_PUBLISH_USERNAME: __token__ | |
UV_PUBLISH_PASSWORD: ${{ secrets.pypi_token }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prepare Environment | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
uv venv && uv pip install hatch | |
uv pip install --editable .[dev] | |
uv pip install --editable .[fast] | |
- name: Flake8 | |
run: | | |
uv run flake8 orbit_predictor | |
- name: Tests | |
run: | | |
uv run pytest -v --cov=orbit_predictor --cov-report= tests/ | |
- name: Publish coverage to Coveralls | |
# If pushed / is a pull request against main repo | |
if: | |
((github.event_name == 'push' && github.repository == 'satellogic/orbit-predictor') || | |
github.event.pull_request.base.repo.full_name == 'satellogic/orbit-predictor') | |
uses: AndreMiras/coveralls-python-action@v20201129 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
flag-name: py${{ matrix.python-version }} | |
parallel: true | |
debug: true | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.13' | |
run: | | |
uv build --sdist --wheel | |
uv publish | |
coveralls-finish: | |
needs: build | |
# If pushed / is a pull request against main repo | |
if: | |
(github.event_name == 'push' && github.repository == 'satellogic/orbit-predictor') || | |
github.event.pull_request.base.repo.full_name == 'satellogic/orbit-predictor' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Coveralls finished | |
uses: AndreMiras/coveralls-python-action@v20201129 | |
with: | |
parallel-finished: true | |
debug: true |