Skip to content

Merge pull request #20 from sphinx-contrib/ci #5

Merge pull request #20 from sphinx-contrib/ci

Merge pull request #20 from sphinx-contrib/ci #5

Workflow file for this run

---
name: CI
"on":
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install ruff pytest
- name: Run ruff format check
run: ruff format --check .
- name: Run ruff lint
run: ruff check .
- name: Run tests
run: |
# Run pytest if test files exist, otherwise just import the module
if [ -d "tests" ] || find . -name "*test*.py" -type f | grep -q .; then
pytest
else
python -c "import sphinxcontrib.googleanalytics; print('Module import successful')"
fi