Skip to content

CI

CI #620

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # every week
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-manifest:
name: Check Manifest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run check-manifest
test:
name: ${{ matrix.platform }} (${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
env:
UV_PRERELEASE: ${{ github.event_name == 'schedule' && 'allow' || 'if-necessary-or-explicit' }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Run min test
run: uv run --no-dev --group test_min pytest -v
- uses: pyvista/setup-headless-display-action@v4
with:
qt: true
- name: Run full test
run: uv run --no-dev --group test_thirdparty coverage run -p -m pytest -v
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: covreport-${{ matrix.platform }}-py${{ matrix.python-version }}
path: ./.coverage*
include-hidden-files: true
upload_coverage:
if: always()
needs: [test]
uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
test-pyinstaller-build:
name: Test pyinstaller
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install package and dev dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest pyinstaller
- name: Unit tests
run: pytest -v --pyargs cmap.__pyinstaller
build-and-inspect-package:
name: Build & inspect package.
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
upload-to-pypi:
name: Upload package to PyPI
needs: build-and-inspect-package
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Download built artifact to dist/
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: 🚢 Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: './dist/*'