Skip to content

Master

Master #52

Workflow file for this run

name: Python Lint and Test
on:
pull_request:
branches:
- 'main'
jobs:
Test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest ./porkbun_ddns/test
- name: Lint with ruff
env:
PY_VER: ${{ matrix.python-version }}
run: |
# stop the build if there are Python syntax errors or undefined names
PY_VER=$(echo py${PY_VER} | tr -d '.')
ruff --output-format=github --ignore=E501 --exclude=__init__.py --target-version=${PY_VER} ./porkbun_ddns
Check-Test:
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- Test
steps:
- run: |
result="${{ needs.Test.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi