forked from nolar/kopf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
111 lines (100 loc) · 4.94 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# The primary environment for testing. Some jobs selectively override these settings.
os: linux
arch: amd64
dist: focal
language: python
python: "3.9-dev"
# Only test the final merges and releases. The work-in-progress branches are tested by PR builds.
branches:
only:
- master
- /^release\/.*$/
- /^\d+\.\d+(\.\d+)?(\.?(rc|dev|pre|post)\d+)?(-\S*)?(\+\S*)?$/
# Linting is super-fast and lightweight, gives the near-instant feedback if code is wrong.
# It does not depend on the environment (services, dependencies, even the framework itself).
# Currently, most linters are optional and performed manually from time to time. This will change.
_linting: &linting
# install: [] # no requirements.txt # TODO: Uncomment again when pre-commit is used (saves ~15s)
services: [] # no docker & co
before_script: []
script:
- isort . --check --diff || true
- isort examples --settings=examples --check --diff || true
# Unit-tests depend on a lightweight environment of the framework and its dependencies only, no K8s.
# Type-checking also needs the dependencies installed, but it goes first for faster failure.
_unittests: &unittests
services: [] # no docker & co
before_script: []
script:
- mypy kopf --strict --pretty
- pytest --cov=kopf --cov-branch
after_success:
- coveralls || true
- codecov --flags unit
# Realistic tests are heavy, slow, but needed even for PRs. They use real K8s of different versions.
# Coverage is not measured in these tests, as all lines will be covered anyway, even if some
# potentially buggy scenarios/edge-cases are missing -- such coverage is not trustworthy.
_integration: &realistic
services:
- docker
before_script:
- tools/install-clients.sh
- tools/install-kubectl.sh
- tools/install-k3d-k3s.sh
script:
- pytest --only-e2e
# Full-scale tests run all setups and all K8s versions (including those not supported by lightweight
# K3d/K3s in PR/branch-tests). They are too slow and too numerous for PRs, so they run by cron only.
# To run/debug in a PR, comment out the `if:` line. Uncomment it back before merging.
_nightly: &fullscale
if: type == cron
services:
- docker
before_script:
- tools/install-clients.sh
- tools/install-kubectl.sh
- tools/install-minikube.sh
script:
- pytest --only-e2e
# The job matrix combines all scripts with all intended setups.
# Only one Python version is tested with all supported K8s versions: to check for API compatibility.
# Other Python versions are tested with only one K8s version: if it works for one, it works for all.
# Ordering is important: 4 heavy jobs (5m) start asap, 3 fast jobs (1+2+2 min) run sequentially,
# thus fitting into Travis's 5-job limit with the fastest possible outcome. For cron, ignore timing.
jobs:
include:
# Regular (daily/nightly) tests for all and old K8s versions. Very slow (8m).
- { <<: *fullscale, env: K8S=latest CLIENT=yes }
- { <<: *fullscale, env: K8S=latest }
- { <<: *fullscale, env: K8S=v1.19.0 }
- { <<: *fullscale, env: K8S=v1.18.8 }
- { <<: *fullscale, env: K8S=v1.17.11 }
- { <<: *fullscale, env: K8S=v1.16.14 }
- { <<: *fullscale, env: K8S=v1.16.14 CRDAPI=v1beta1 }
- { <<: *fullscale, env: K8S=v1.15.12 CRDAPI=v1beta1 }
- { <<: *fullscale, env: K8S=v1.14.10 CRDAPI=v1beta1 }
- { <<: *fullscale, env: K8S=v1.13.12 CRDAPI=v1beta1 }
# Integration tests are slow (5-6m). Limit to 4 representative setups for faster PR feedbacks.
- { <<: *realistic, env: K3S=latest CLIENT=yes }
- { <<: *realistic, env: K3S=v1.18.8+k3s1 }
- { <<: *realistic, env: K3S=v1.16.14+k3s1 }
- { <<: *realistic, env: K3S=v1.16.14+k3s1 CRDAPI=v1beta1 }
# Linting is super-fast and lightweight (40s), gives the near-instant feedback.
# Unit-tests are relatively fast (2m), but no integration tests, no k8s installed.
# This pack of jobs takes roughly 5m, which is a duration of one realistic job.
- { <<: *linting, name: Linting and static analysis }
- { <<: *unittests, python: "3.7" }
- { <<: *unittests, python: "3.8" }
- { <<: *unittests, python: "3.9-dev" }
fast_finish: true
allow_failures:
- python: "3.10-dev"
deploy:
provider: pypi
username: "__token__"
password:
secure: "jkf7ncg2doyqEkASa4NFtNt9BfOcFvGvFIAj/jU55sCkKGfvavzC262/kmJnTZpF1ZStjL+z3AwSLT09cYtlujA/FRdPmuNzyRgr2j4D20Txx5whHj8zYdklquhEHbXo7FU+nQTDxkLqr35KEnMBIzoesz7xHoOH/MLzK5w2Ow8DprAjVVSY0Dv+glJ15qWo/pwNp1xetMGYjdO4ys4amdsvRlU4LmCcuMf5LsnuJyuR7yHsBs6CqmnitJezZ+fgGKqJDEC+jy/+q7aOc6V2iCDsOH5NNniUeVKTuDhmvK+1y146VVqWw+RqIG27cMyYbocmJhYRBQoLbwCKLPKF2l2YtgjKdt9izyYbjjBAVIUtsavGrsNSk08ujS8OCs9/4YXFFMjTTKwF+Hy0RqmIMNK2ymn8pWpo9HTJT2td9b0HkVikDX3D8sezD1koSxDTWYFs3MMVDPTA9lWL3sIFVHhQRr3rlk+qsoSsP5/SvVMGJv4NIjIi+SZaLvqR+aPaO1H92zVkhcMbNN3cNHE8ak1LXUmnr008xjJzsT+Y+wthx6G1zpFRSLH4dP7myxF0Zk7uJQPhaQTflICseVW4mp72HeraTKc+QHKZthTXwFeMVVSTdgNpVMpfYnjolkGXdubDbhhDhz6B4OzIRZXqiIUANHsT5zGiS0OjN7Pa4lY="
distributions: sdist bdist_wheel
skip_existing: true
on:
tags: true # prohibit local versions not on the releases