Skip to content

[pre-commit.ci] pre-commit autoupdate #608

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #608

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: uv.lock
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Test SpectraFit
run: uv run --group dev --all-extras pytest umf/
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
docs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv and dependencies with doc-dependencies
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: uv.lock
python-version: "3.10"
- name: Install the project
run: uv sync --all-extras --group docs
- name: Set git config
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Build documentation
if: ${{ !contains(github.ref, 'refs/heads/main')}}
run: uv run --group docs --all-extras mkdocs build --clean
- name: Deploy documentation develops
if: contains(github.ref, 'refs/heads/main')
run: uv run --group docs --all-extras mike deploy --push --update-aliases develop