Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

add collector for CI on PR's and remove unused CI (#2379)

João Gustavo A. Amorimc9e546268a6b
diff --git a/.github/actions_info.md b/.github/actions_info.md
index da969bd0a..1a130be37 100644
--- a/.github/actions_info.md
+++ b/.github/actions_info.md
@@ -33,9 +33,9 @@ Use the actions:
Has the inputs:
- `os`: (string, default: `ubuntu-latest`) the OS name same as supported by [gha](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners).
-- `python-version`: (json list of strings, default: `'["3.8"]'`) a string with
+- `python-version`: (json list of strings, default: `'["3.10"]'`) a string with
format of a json list within strings for each python version desired.
-- `pytorch-version`: (json list of strings, default: `'["1.9.1"]'`) a string
+- `pytorch-version`: (json list of strings, default: `'["2.0.0"]'`) a string
with format of a json list within strings for each pytorch version desired.
- `pytorch-dtype`: (string, default: `float32`) the dtype used to generate
the tests with pytest.
@@ -49,7 +49,7 @@ Has the inputs:
A matrix strategy will be adopted from the list of python and pytorch version.
### Tests tutorials
-This workflow ([.github/workflows/tests_tutorials.yml](workflows/tests_tutorials.yml)) will setup
+This workflow ([.github/workflows/test_tutorials.yml](workflows/tests_tutorials.yml)) will setup
an environment using the [env](#Env) action, clone the [tutorials repo](https://github.com/kornia/tutorials), and execute the tutorials.
Use the actions:
@@ -66,3 +66,21 @@ Has the inputs:
the matrix strategy.
A matrix strategy will be adopted from the list of python and pytorch version.
+
+### Tests typing
+This workflow ([.github/workflows/test_typing.yml](workflows/test_typing.yml)) will setup
+an environment using the [env](#Env) action, run the typing tests using mypy and
+uploading the coverage report to codecov.
+
+Use the actions:
+- `actions/checkout`
+- `.github/actions/env`
+
+Has the inputs:
+- `os`: (string, default: `ubuntu-latest`) the OS name same as supported by [gha](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners).
+- `python-version`: (json list of strings, default: `'["3.10"]'`) a string with
+ format of a json list within strings for each python version desired.
+- `pytorch-version`: (json list of strings, default: `'["2.0.0"]'`) a string
+ with format of a json list within strings for each pytorch version desired.
+- `fail-fast`: (boolean, default: `false`) to set the `fail-fast` behavior on
+ the matrix strategy.
diff --git a/.github/configurations/changelog-ci-config.json b/.github/configurations/changelog-ci-config.json
deleted file mode 100644
index 2629b507b..000000000
--- a/.github/configurations/changelog-ci-config.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "comment_changelog": true,
- "commit_changelog": false,
- "group_config": [
- {
- "labels": [
- "bug",
- "bugfix"
- ],
- "title": "Bug Fixes"
- },
- {
- "labels": [
- "improvements",
- "enhancement"
- ],
- "title": "Code Improvements"
- },
- {
- "labels": [
- "feature",
- "feature request"
- ],
- "title": "New Features"
- },
- {
- "labels": [
- "docs",
- "documentation",
- "doc"
- ],
- "title": "Documentation Updates"
- }
- ],
- "header_prefix": "Version:",
- "pull_request_title_regex": "^(?i:release)",
- "version_regex": "v?([0-9]{1,2})[.]([0-9]{1,2})[.]([0-9]{1,2})\\s\\(\\d{1,2}-\\d{1,2}-\\d{4}\\)"
-}
diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml
deleted file mode 100644
index 0914825f2..000000000
--- a/.github/workflows/changelog.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: Changelog CI
-
-on:
- pull_request:
- types: [opened, reopened]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/[email protected]
- - name: Run Changelog CI
- uses: saadmk11/[email protected]
- with:
- changelog_filename: CHANGELOG.md
- config_file: .github/configurations/changelog-ci-config.json
- env:
- GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
diff --git a/.github/workflows/pr_test_cpu.yml b/.github/workflows/pr_test_cpu.yml
index c5bafa81c..f8217bd45 100644
--- a/.github/workflows/pr_test_cpu.yml
+++ b/.github/workflows/pr_test_cpu.yml
@@ -1,4 +1,4 @@
-name: Run tests on CPU
+name: Tests on CPU (PR)
on:
push:
@@ -15,7 +15,7 @@ concurrency:
jobs:
tests-cpu:
strategy:
- fail-fast: false # TODO: enable it when CI be stable
+ fail-fast: false # TODO: enable it when CI be stable (when drop support to torch 1.9.1)
matrix:
os: ['Ubuntu-latest', 'Windows-latest', 'MacOS-latest']
uses: ./.github/workflows/tests.yml
@@ -25,33 +25,33 @@ jobs:
pytorch-version: '["1.9.1", "2.0.0"]'
pytorch-dtype: 'float32'
- tests-cpu-old-torch-new-py:
- strategy:
- fail-fast: false
- matrix:
- os: ['Ubuntu-latest', 'Windows-latest', 'MacOS-latest']
-
- uses: ./.github/workflows/tests.yml
- with:
- os: ${{ matrix.os }}
- python-version: '["3.9"]'
- pytorch-dtype: 'float32'
-
tests-cpu-fp64:
strategy:
fail-fast: true
- matrix:
- os: ['Ubuntu-latest']
uses: ./.github/workflows/tests.yml
with:
- os: ${{ matrix.os }}
python-version: '["3.8", "3.10"]'
pytorch-version: '["1.9.1", "2.0.0"]'
pytorch-dtype: 'float64'
+ test-typing:
+ uses: ./.github/workflows/test_typing.yml
+
+ test-tutorials:
+ uses: ./.github/workflows/test_tutorials.yml
+
+ collector:
+ needs: [tests-cpu, tests-cpu-fp64, test-tutorials, test-typing]
+ if: always()
+ runs-on: ubuntu-latest
+ steps:
+ - name: check for failures
+ if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
+ run: echo job failed && exit 1
+
tests-nightly:
if: contains(github.event.pull_request.labels.*.name, 'nightly')
- name: ${{ matrix.os }} - python-${{ matrix.python-version }}, torch-nightly, ${{ matrix.pytorch-dtype }}
+ name: ${{ matrix.os }} - torch-nightly, ${{ matrix.pytorch-dtype }}
strategy:
fail-fast: false
@@ -62,28 +62,5 @@ jobs:
uses: ./.github/workflows/tests.yml
with:
os: ${{ matrix.os }}
- python-version: '["3.10"]'
pytorch-version: '["nightly"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
-
- tests-tutorials:
- strategy:
- fail-fast: false
- matrix:
- os: ['Ubuntu-latest']
- uses: ./.github/workflows/tests_tutorials.yml
- with:
- os: ${{ matrix.os }}
- python-version: '["3.10"]'
- pytorch-version: '["2.0.0"]'
-
- # tests-cpu-half:
- # strategy:
- # fail-fast: false # TODO: enable it when CI be stable
- # uses: ./.github/workflows/tests.yml
- # with:
- # os: 'Ubuntu-latest'
- # python-version: '["3.10"]'
- # pytorch-version: '["2.0.0"]'
- # pytorch-dtype: 'float16'
- # continue-on-error: true
diff --git a/.github/workflows/pr_test_typing.yml b/.github/workflows/pr_test_typing.yml
deleted file mode 100644
index e4de0153c..000000000
--- a/.github/workflows/pr_test_typing.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Run typing tests
-
-on:
- pull_request:
- branches: [master, test-me-*]
- types: [opened, reopened, synchronize, ready_for_review]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- tests:
- name: ${{ matrix.os }} - python-${{ matrix.python-version }}, torch-${{ matrix.pytorch-version }}
- runs-on: ${{ matrix.os }}-latest
-
- strategy:
- fail-fast: false
- matrix:
- os: ['Ubuntu']
- python-version: ['3.8']
- pytorch-version: ['2.0.0']
-
- steps:
- - name: Checkout kornia
- uses: actions/checkout@v3
-
- - name: Setting environment on ${{ matrix.os }} with python ${{ matrix.python-version }} and pytorch ${{ matrix.pytorch-version }}
- uses: ./.github/actions/env
- with:
- python-version: ${{ matrix.python-version }}
- pytorch-version: ${{ matrix.pytorch-version }}
-
- - name: Run typing tests
- shell: bash -l {0}
- run: mypy --cobertura-xml-report ./
-
- - if: always()
- name: Upload coverage
- uses: codecov/codecov-action@v3
- with:
- file: cobertura.xml
- token: ${{ secrets.CODECOV_TOKEN }} # to not depend on build via GH API
- flags: typing,${{ matrix.os }}_py-${{ matrix.python-version }}_pt-${{ matrix.pytorch-version }}_${{ matrix.pytorch-dtype }}
- name: cpu-coverage-types
diff --git a/.github/workflows/scheduled_test_cpu.yml b/.github/workflows/scheduled_test_cpu.yml
index bef18d2b6..6ea40e1ca 100644
--- a/.github/workflows/scheduled_test_cpu.yml
+++ b/.github/workflows/scheduled_test_cpu.yml
@@ -7,7 +7,7 @@ on:
- cron: "0 4 * * *"
concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
@@ -47,17 +47,10 @@ jobs:
uses: ./.github/workflows/tests.yml
with:
os: 'MacOS-latest'
- python-version: '["3.10"]'
- pytorch-version: '["2.0.0"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
- tests-tutorials:
- strategy:
- fail-fast: false
- matrix:
- os: ['Ubuntu-latest']
- uses: ./.github/workflows/tests_tutorials.yml
- with:
- os: ${{ matrix.os }}
- python-version: '["3.10"]'
- pytorch-version: '["2.0.0"]'
+ test-tutorials:
+ uses: ./.github/workflows/test_tutorials.yml
+
+ test-typing:
+ uses: ./.github/workflows/test_typing.yml
diff --git a/.github/workflows/python_package.yml b/.github/workflows/scheduled_test_pypi_package.yml
similarity index 61%
rename from .github/workflows/python_package.yml
rename to .github/workflows/scheduled_test_pypi_package.yml
index 9eb3e8fc3..9344893bf 100644
--- a/.github/workflows/python_package.yml
+++ b/.github/workflows/scheduled_test_pypi_package.yml
@@ -1,4 +1,4 @@
-name: Python package
+name: Test PyPI package
on:
schedule:
@@ -21,8 +21,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- - name: Download Kornia binary
+ - name: Pip install Kornia
+ run: pip install kornia
+
+ - name: Check dependencies and kornia version
run: |
- pip install torch -f https://download.pytorch.org/whl/torch_stable.html
- pip install kornia
- python -c "import kornia"
+ python -c "import torch;print('Pytorch version: ', torch.__version__)"
+ python -c "import kornia;print('Kornia version: ', kornia.__version__)"
diff --git a/.github/workflows/scheduled_test_typing.yml b/.github/workflows/scheduled_test_typing.yml
deleted file mode 100644
index 6a64ace45..000000000
--- a/.github/workflows/scheduled_test_typing.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: Run typing tests (scheduled)
-
-on:
- push:
- branches: [master, test-me-*]
-
- schedule:
- - cron: "0 4 * * *"
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- tests:
- name: ${{ matrix.os }} - python-${{ matrix.python-version }}, torch-${{ matrix.pytorch-version }}
- runs-on: ${{ matrix.os }}-latest
-
- strategy:
- fail-fast: false
- matrix:
- os: ['Ubuntu']
- python-version: ['3.8']
- pytorch-version: ['2.0.0']
-
- steps:
- - name: Checkout kornia
- uses: actions/checkout@v3
-
- - name: Setting environment on ${{ matrix.os }} with python ${{ matrix.python-version }} and pytorch ${{ matrix.pytorch-version }}
- uses: ./.github/actions/env
- with:
- python-version: ${{ matrix.python-version }}
- pytorch-version: ${{ matrix.pytorch-version }}
-
- - name: Run typing tests
- shell: bash -l {0}
- run: mypy --cobertura-xml-report ./
-
- - if: always()
- name: Upload coverage
- uses: codecov/codecov-action@v3
- with:
- file: cobertura.xml
- token: ${{ secrets.CODECOV_TOKEN }} # to not depend on build via GH API
- flags: typing,${{ matrix.os }}_py-${{ matrix.python-version }}_pt-${{ matrix.pytorch-version }}_${{ matrix.pytorch-dtype }}
- name: cpu-coverage-types
diff --git a/.github/workflows/tests_tutorials.yml b/.github/workflows/test_tutorials.yml
similarity index 100%
rename from .github/workflows/tests_tutorials.yml
rename to .github/workflows/test_tutorials.yml
diff --git a/.github/workflows/test_typing.yml b/.github/workflows/test_typing.yml
new file mode 100644
index 000000000..bb979c3f0
--- /dev/null
+++ b/.github/workflows/test_typing.yml
@@ -0,0 +1,57 @@
+on:
+ workflow_call:
+ inputs:
+ python-version:
+ required: false
+ type: string
+ default: '["3.10"]'
+ pytorch-version:
+ required: false
+ type: string
+ default: '["2.0.0"]'
+ os:
+ required: false
+ type: string
+ default: ubuntu-latest
+ fail-fast:
+ required: false
+ type: boolean
+ default: false
+
+jobs:
+ tests-typing:
+ name: python-${{ matrix.python-version }}, torch-${{ matrix.pytorch-version }}
+ runs-on: ${{ inputs.os }}
+ strategy:
+ fail-fast: ${{ inputs.fail-fast }}
+ matrix:
+ python-version: ${{ fromJSON(inputs.python-version) }}
+ pytorch-version: ${{ fromJSON(inputs.pytorch-version) }}
+ exclude:
+ - pytorch-version: '1.9.1'
+ python-version: '3.10'
+ - pytorch-version: '1.10.2'
+ python-version: '3.10'
+
+ steps:
+ - name: Checkout kornia
+ uses: actions/checkout@v3
+
+ - name: Setting environment on ${{ inputs.os }} with python ${{ matrix.python-version }} and pytorch ${{ matrix.pytorch-version }}
+ uses: ./.github/actions/env
+ with:
+ python-version: ${{ matrix.python-version }}
+ pytorch-version: ${{ matrix.pytorch-version }}
+
+ - name: Run typing tests
+ shell: bash -l {0}
+ run: mypy --cobertura-xml-report ./
+
+ - if: always()
+ name: Upload typing coverage
+ uses: codecov/codecov-action@v3
+ with:
+ file: cobertura.xml
+ token: ${{ secrets.CODECOV_TOKEN }} # to not depend on build via GH API
+ flags: typing,${{ inputs.os }}_py-${{ matrix.python-version }}_pt-${{ matrix.pytorch-version }}_${{ inputs.pytorch-dtype }}
+ name: cpu-coverage-types
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 5b8d95af7..d4d3e4792 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -4,11 +4,11 @@ on:
python-version:
required: false
type: string
- default: '["3.8"]'
+ default: '["3.10"]'
pytorch-version:
required: false
type: string
- default: '["1.9.1"]'
+ default: '["2.0.0"]'
os:
required: false
type: string
@@ -48,6 +48,7 @@ jobs:
steps:
- name: Checkout kornia
uses: actions/checkout@v3
+
- name: Setting environment on ${{ inputs.os }} with python ${{ matrix.python-version }} and pytorch ${{ matrix.pytorch-version }}
uses: ./.github/actions/env
with:
@@ -59,7 +60,6 @@ jobs:
shell: bash -l {0}
run: pytest -v --device cpu --dtype ${{ inputs.pytorch-dtype }} ${{ inputs.pytest-extra }} --cov=kornia --cov-report xml ./test
-
- if: always()
name: Upload coverage
uses: codecov/codecov-action@v3
diff --git a/.github/workflows/tests_cuda.yml b/.github/workflows/tests_cuda.yml
deleted file mode 100644
index 96095dc57..000000000
--- a/.github/workflows/tests_cuda.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: tests-cuda
-
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
- schedule:
- - cron: "0 0 * * *"
-
-jobs:
- tests-cuda:
- container:
- image: pytorch/pytorch:1.6.0-cuda10.1-cudnn7-runtime
- options: --gpus all
- runs-on: [self-hosted, Linux, x64]
- steps:
- - uses: actions/checkout@v2
- - name: Install dependencies
- shell: bash -l {0}
- run: |
- # NOTE: pytorch image does not include git
- conda install -c anaconda git
- pip install .[dev,x]
- - name: Run Tests
- shell: bash -l {0}
- run: pytest -v --device cuda --dtype float32,float64 ./test