Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge pull request #1200 from mdnfiras/main #517

Merge pull request #1200 from mdnfiras/main

Merge pull request #1200 from mdnfiras/main #517

Workflow file for this run

# The thorough tests run only on the main branch after everything is merged,
# and regularly by time —- on order to detect bugs and incompatibility with
# the new versions of freshly released software (e.g. K8s, K3s, Python libs).
# The first part fully includes the CI workflow, with more versions of K3d/K3s.
# The second part is unique to the thorough tests.
name: Thorough tests
on:
push:
branches:
- main
- release/**
schedule:
- cron: "13 3 * * 6"
workflow_dispatch: {}
jobs:
linters:
name: Linting and static analysis
runs-on: ubuntu-24.04
timeout-minutes: 5 # usually 1-2, rarely 3 mins (because of installations)
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: pip install --group lint -e .
- run: pre-commit run --all-files
- run: mypy kopf --strict
- run: |
# Mypying the examples
exit_codes=0
for d in $(find examples -maxdepth 1 -mindepth 1 -type d)
do
echo "Checking ${d}"
mypy $d
exit_codes=$[${exit_codes} + $?]
done
exit ${exit_codes}
unit-tests:
strategy:
fail-fast: false
matrix:
install-extras: [ "", "full-auth" ]
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
include:
- install-extras: "uvloop"
python-version: "3.14"
name: Python ${{ matrix.python-version }}${{ matrix.install-extras && ' ' || '' }}${{ matrix.install-extras }}
runs-on: ubuntu-24.04
timeout-minutes: 5 # usually 2-3 mins
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- run: pip install --group test -e .
- run: pip install -e .[${{ matrix.install-extras }}]
if: ${{ matrix.install-extras }}
- run: pytest --color=yes --timeout=2
# - run: pytest --color=yes --timeout=2 --cov=kopf --cov-branch
- name: Publish coverage to Coveralls.io
if: success()
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true
- name: Publish coverage to CodeCov.io
uses: codecov/codecov-action@v5
if: success()
env:
PYTHON: ${{ matrix.python-version }}
with:
flags: unit
env_vars: PYTHON
continue-on-error: true
# Only the core functionality is tested: no e2e or functional tests (for simplicity).
# No coverage: PyPy performs extremely poorly with tracing/coverage (13 mins vs. 3 mins).
# Extra time: 2-3 mins for building the dependencies (since no binary wheels are available).
# Extra time: PyPy is good with JIT for repetitive code; tests are too unique for JIT.
pypy-tests:
strategy:
fail-fast: false
matrix:
install-extras: [ "", "full-auth" ]
python-version: [ "pypy-3.10", "pypy-3.11" ]
name: Python ${{ matrix.python-version }}${{ matrix.install-extras && ' ' || '' }}${{ matrix.install-extras }}
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt-dev
- run: pip install --upgrade pip wheel setuptools
- run: pip install --group test -e .
- run: pip install -e .[${{ matrix.install-extras }}]
if: ${{ matrix.install-extras }}
- run: pytest --color=yes --timeout=2 --no-cov
functional:
strategy:
fail-fast: false
matrix:
k3s: [latest, v1.33, v1.32, v1.31]
name: K3s ${{matrix.k3s}}
runs-on: ubuntu-24.04
timeout-minutes: 10 # usually 4-5 mins
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- uses: nolar/setup-k3d-k3s@v1
with:
version: ${{ matrix.k3s }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: pip install --group test -e . -r examples/requirements.txt
- run: pytest --color=yes --timeout=30 --only-e2e
full-scale:
strategy:
fail-fast: false
matrix:
k8s: [latest, v1.33.5, v1.32.9, v1.31.13]
name: K8s ${{matrix.k8s}}
runs-on: ubuntu-24.04
timeout-minutes: 10 # usually 4-5 mins
env:
K8S: ${{ matrix.k8s }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: tools/install-minikube.sh
- run: pip install --group test -e . -r examples/requirements.txt
- run: pytest --color=yes --timeout=30 --only-e2e
coveralls-finish:
name: Finalize coveralls.io
needs: [unit-tests, pypy-tests, functional]
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-python@v6
- run: pip install coveralls
- run: coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true