Skip to content

chore(deps): update astral-sh/setup-uv action to v3.1.4 #1128

chore(deps): update astral-sh/setup-uv action to v3.1.4

chore(deps): update astral-sh/setup-uv action to v3.1.4 #1128

Workflow file for this run

---
# Taken from pyhaversion
name: Actions
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docfiles: ${{ steps.filter.outputs.docfiles }}
steps:
- uses: actions/[email protected]
- uses: dorny/[email protected]
id: filter
with:
filters: |
docfiles:
- 'src/pysmsboxnet/*.py'
- 'docs/**'
- 'pyproject.toml'
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/[email protected]
- name: πŸ›  Set up UV and Python 3
uses: astral-sh/[email protected]
id: python
with:
enable-cache: true
cache-suffix: lint
- name: πŸ“¦ Install dependencies
run: uv sync --frozen --extra lint
- name: Pre-commit cache
uses: actions/[email protected]
with:
path: ~/.cache/pre-commit
key: "${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }}"
restore-keys: |
${{ runner.os }}-pre-commit-
- name: "πŸ–€ Run pre-commits"
run: uv run pre-commit run --show-diff-on-failure --all-files
test:
name: Test with Python ${{ matrix.python-version }} on ${{ matrix.os }}
needs: lint
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
python-version: ["3.10", 3.11, 3.12]
os: [ubuntu, windows, macos]
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/[email protected]
- name: πŸ› οΈ Set up UV and Python ${{ matrix.python-version }}
uses: astral-sh/[email protected]
with:
enable-cache: true
cache-suffix: test-${{ matrix.python-version }}-${{ matrix.os }}
- name: install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: πŸ“¦ Install dependencies
run: uv sync --frozen --extra test
- name: πŸƒ Run tests
run: uv run pytest tests
- name: Run code coverage
if: ${{ matrix.python-version == '3.10' }}
run: uv run pytest --cov=./src --cov-report=xml tests
- name: upload to codecov
if: ${{ matrix.python-version == '3.10' }}
uses: codecov/[email protected]
test_install:
name: "Test install with Python ${{matrix.python-version}} ${{matrix.os}}"
needs: test
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
python-version: ["3.10", 3.11, 3.12]
os: [ubuntu, windows, macos]
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/[email protected]
- name: πŸ› οΈ Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install using pip
run: pip3 install .
- name: Try example in temporary directory
env:
SMSBOX_API_KEY: ${{ secrets.SMSBOX_API_KEY }}
RUNNER_TEMP: ${{ runner.temp }}
run: |
python3 script/copy_example.py
cd ${{ runner.temp }}/test_example
python3 ${{ runner.temp }}/test_example/example.py
test_build:
name: Test building with Python 3
needs: test_install
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/[email protected]
- name: πŸ› οΈ Set up Python 3 and UV
uses: astral-sh/[email protected]
id: python
- name: Run build
run: uv build
deploy_doc:
if: github.event_name == 'push' && needs.changes.outputs.docfiles == 'true'
needs: [test_build, changes]
permissions:
contents: write
runs-on: ubuntu-latest
name: Build and deploydocumentation from main
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: πŸ›  Set up Python3
uses: astral-sh/[email protected]
id: python
- name: πŸ“¦ Install dependencies
run: uv sync --frozen --extra doc
- name: Build documentation using sphinx
run: uv run make -C docs html
- name: deploy documentation
uses: JamesIves/[email protected]
with:
folder: docs/_build/html
target-folder: dev