Sync Upstream 20250922 #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python Lint and Test | |
| on: | |
| pull_request: | |
| branches: | |
| - 'main' | |
| jobs: | |
| Test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| 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 check --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 |