Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Travis CI to GitHub Actions
Travis CI has a new pricing model since Nov'2020 with "credits" per build-minutes. The credits were depleted quite fast. There is no clear way to buy more credits, there is no clear way to request more for an open-source project, there are no clear criteria on what counts as open-source. And even if requested, the build-minutes are used fast (mostly by nightly builds) — 10'000 credits were depleted in two weeks. That might work for tiny project, but for K8s tests matrix, those credits are not enough. Besides, Travis CI has introduced the limited capacity for open-source builds, so there were a few cases when the builds were waiting for 1 hour in the backlog to be executed. This kills all the optimisations made to get the PR feedback faster, in ~5 mins. GitHub Actions offer unlimited build-minutes for public repositories, i.e. for open-source. The pricing model is clear, if it would be ever needed. If and when GitHub will cancel free builds for open-source/public repositories, that approach can be revised again in favour of Travis CI or maybe other CI tools.
- Loading branch information
Showing
10 changed files
with
189 additions
and
138 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish to PyPI | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
# push: | ||
# tags: | ||
# - "[0-9]+.[0-9]+*" | ||
|
||
jobs: | ||
publish: | ||
name: Build and publish | ||
if: startsWith(github.event.ref, 'refs/tags') | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- run: pip install --upgrade setuptools wheel twine | ||
- run: python setup.py sdist bdist_wheel | ||
- uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_token }} | ||
skip_existing: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
name: Tests | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- release/** | ||
paths-ignore: | ||
- "*.md" | ||
- "docs/**" | ||
pull_request: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: "13 3 * * *" | ||
|
||
jobs: | ||
linters: | ||
name: Linting and static analysis | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
- run: pip install -r requirements.txt | ||
- run: isort . --check --diff | ||
continue-on-error: true | ||
- run: isort examples --settings=examples --check --diff | ||
continue-on-error: true | ||
|
||
unit-tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9" ] | ||
name: Python ${{ matrix.python-version }} | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install -r requirements.txt | ||
- run: mypy kopf --strict --pretty | ||
- run: pytest --cov=kopf --cov-branch --junit-xml=junit.xml | ||
- run: coveralls || true | ||
if: ${{ success() }} | ||
- run: codecov --flags unit | ||
if: ${{ success() }} | ||
# - uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: JUnit for ${{ matrix.python-version }} | ||
# path: junit.xml | ||
# if: ${{ always() }} | ||
|
||
functional: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
k3s: [latest, v1.18.8+k3s1, v1.16.14+k3s1] | ||
client: [true, false] | ||
crdapi: ["", v1beta1] | ||
exclude: | ||
- client: true | ||
- crdapi: v1beta1 | ||
include: | ||
- k3s: v1.16.14+k3s1 | ||
crdapi: v1beta1 | ||
client: false | ||
- k3s: latest | ||
crdapi: "" | ||
client: true | ||
name: >- | ||
K3s ${{matrix.k3s}} | ||
${{matrix.crdapi && format('CRD={0}', matrix.crdapi) || ''}} | ||
${{matrix.client && '+client' || ''}} | ||
runs-on: ubuntu-20.04 | ||
env: | ||
K3S: ${{ matrix.k3s }} | ||
CLIENT: ${{ matrix.client || '' }} | ||
CRDAPI: ${{ matrix.crdapi || '' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
- run: pip install -r requirements.txt | ||
- run: tools/install-clients.sh | ||
- run: tools/install-kubectl.sh | ||
- run: tools/install-k3d-k3s.sh | ||
- run: pytest --only-e2e | ||
|
||
full-scale-crd-v1: | ||
# if: ${{ github.event_name == 'schedule' }} # TODO | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
k8s: [latest, v1.19.0, v1.18.8, v1.17.11, v1.16.14] | ||
client: [true, false] | ||
crdapi: [""] | ||
python-version: ["3.9"] | ||
exclude: | ||
- client: true | ||
include: | ||
- k8s: latest | ||
client: true | ||
name: >- | ||
K8s ${{matrix.k8s}} | ||
${{matrix.crdapi && format('CRD={0}', matrix.crdapi) || ''}} | ||
${{matrix.client && '+client' || ''}} | ||
runs-on: ubuntu-20.04 | ||
env: | ||
K8S: ${{ matrix.k8s }} | ||
CLIENT: ${{ matrix.client || '' }} | ||
CRDAPI: ${{ matrix.crdapi || '' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install -r requirements.txt | ||
- run: tools/install-clients.sh | ||
- run: tools/install-kubectl.sh | ||
- run: tools/install-minikube.sh | ||
- run: pytest --only-e2e | ||
|
||
full-scale-crd-v1beta1: | ||
# if: ${{ github.event_name == 'schedule' }} # TODO | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
k8s: [v1.16.14, v1.15.12, v1.14.10, v1.13.12] | ||
client: [false] | ||
crdapi: [v1beta1] | ||
python-version: ["3.9"] | ||
name: >- | ||
K8s ${{matrix.k8s}} | ||
${{matrix.crdapi && format('CRD={0}', matrix.crdapi) || ''}} | ||
${{matrix.client && '+client' || ''}} | ||
runs-on: ubuntu-20.04 | ||
env: | ||
K8S: ${{ matrix.k8s }} | ||
CLIENT: ${{ matrix.client || '' }} | ||
CRDAPI: ${{ matrix.crdapi || '' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install -r requirements.txt | ||
- run: tools/install-clients.sh | ||
- run: tools/install-kubectl.sh | ||
- run: tools/install-minikube.sh | ||
- run: pytest --only-e2e |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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