Skip to content

chore(deps): update jamesives/github-pages-deploy-action action to v4.7.4 #1848

chore(deps): update jamesives/github-pages-deploy-action action to v4.7.4

chore(deps): update jamesives/github-pages-deploy-action action to v4.7.4 #1848

Workflow file for this run

---
# Taken from pyhaversion
# yamllint disable rule:line-length
name: Actions
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docfiles: ${{ steps.filter.outputs.docfiles }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
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/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: πŸ›  Set up UV and Python 3
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
id: python
with:
enable-cache: true
cache-suffix: lint
- name: πŸ“¦ Install dependencies
run: uv sync --frozen --group lint
- name: Pre-commit cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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.11, 3.12, 3.13]
os: [ubuntu, windows, macos]
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: πŸ› οΈ Set up UV and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
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 --group test
- name: πŸƒ Run tests
run: uv run pytest tests
- name: Run code coverage
run: uv run pytest --cov=./src --cov-report=xml tests
- name: upload to codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
test_install:
name: "Test install with Python ${{matrix.python-version}} ${{matrix.os}}"
needs: test
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
os: [ubuntu, windows, macos]
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: πŸ› οΈ Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install using pip
run: python -m pip install .
- name: Try example in temporary directory
env:
SMSBOX_API_KEY: ${{ secrets.SMSBOX_API_KEY }}
RUNNER_TEMP: ${{ runner.temp }}
run: |
python scripts/copy_example.py
cd ${{ runner.temp }}/test_example
python ${{ 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/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: πŸ› οΈ Set up Python 3 and UV
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
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 deploy documentation from main
steps:
- name: πŸ“₯ Checkout the repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: πŸ›  Set up Python3
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
id: python
- name: πŸ“¦ Install dependencies
run: uv sync --frozen --group doc
- name: Build documentation using sphinx
run: uv run make -C docs html
- name: deploy documentation
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4.7.4
with:
folder: docs/_build/html
target-folder: dev
alls_green:
name: Check if all checks are green
if: always()
needs:
- lint
- test
- test_install
- test_build
runs-on: ubuntu-latest
steps:
- name: Decide if checks succeeded or not
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
allowed-skips: changes
jobs: ${{ toJSON(needs) }}