Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

update CI nightly (#2106)

João Gustavo A. Amorim63c1f36a66c8
diff --git a/.github/actions/env/action.yml b/.github/actions/env/action.yml
index 4e8a3ea35..750518b13 100644
--- a/.github/actions/env/action.yml
+++ b/.github/actions/env/action.yml
@@ -28,12 +28,14 @@ runs:
shell: bash -l {0}
run: conda install curl -c conda-forge
- - if: ${{ contains(fromJson('["lts", "nightly"]'), inputs.pytorch-version ) }}
- name: Install pytorch
+ - if: ${{ contains(fromJson('["nightly"]'), inputs.pytorch-version ) }}
+ name: Install dependencies
shell: bash -l {0}
- run: conda install pytorch cpuonly -c pytorch-${{ inputs.pytorch-version }}
+ run: |
+ pip install numpy --pre torch[dynamo] --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cpu/
+ pip install onnx
- - if: ${{ contains(fromJson('["lts", "nightly"]'), inputs.pytorch-version ) == false}}
+ - if: ${{ contains(fromJson('["nightly"]'), inputs.pytorch-version ) == false}}
name: Install pytorch
shell: bash -l {0}
run: conda install pytorch=${{ inputs.pytorch-version }} cpuonly -c pytorch
diff --git a/.github/workflows/scheduled_test_cpu.yml b/.github/workflows/scheduled_test_cpu.yml
index 5c6378a84..428d370d7 100644
--- a/.github/workflows/scheduled_test_cpu.yml
+++ b/.github/workflows/scheduled_test_cpu.yml
@@ -1,4 +1,4 @@
-name: (scheduled) Run tests on CPU
+name: (scheduled) Tests on CPU
on:
push:
@@ -20,7 +20,7 @@ jobs:
matrix:
os: ['Ubuntu', 'Windows', 'MacOS']
python-version: ['3.7', '3.8']
- pytorch-version: ['1.9.1', '1.10.2', '1.12.1', '1.13.0', 'nightly']
+ pytorch-version: ['1.9.1', '1.10.2', '1.12.1', '1.13.0']
pytorch-dtype: ['float16', 'float32', 'float64']
steps:
diff --git a/.github/workflows/tests_nightly.yml b/.github/workflows/tests_nightly.yml
new file mode 100644
index 000000000..fce36bf09
--- /dev/null
+++ b/.github/workflows/tests_nightly.yml
@@ -0,0 +1,51 @@
+name: Tests on CPU (nightly)
+
+on:
+ pull_request:
+ branches: [master]
+ types: [opened, reopened, synchronize, review_requested, ready_for_review]
+ push:
+ branches: [master]
+ schedule:
+ - cron: "0 4 * * *"
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ tests-cpu:
+ name: ${{ matrix.os }} - python-${{ matrix.python-version }}, torch-${{ matrix.pytorch-version }}, ${{ matrix.pytorch-dtype }}
+ runs-on: ${{ matrix.os }}-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ os: ['Ubuntu', 'Windows', 'MacOS']
+ python-version: ['3.7', '3.8']
+ pytorch-version: ['nightly']
+ pytorch-dtype: ['float32', 'float64']
+
+ 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 CPU tests ${{ matrix.pytorch-dtype }}
+ shell: bash -l {0}
+ run: pytest -v --device cpu --dtype ${{ matrix.pytorch-dtype }} --cov=kornia --cov-report xml ./test
+
+
+ - if: always()
+ name: Upload coverage
+ uses: codecov/codecov-action@v3
+ with:
+ file: coverage.xml
+ token: ${{ secrets.CODECOV_TOKEN }} # to not depend on build via GH API
+ flags: cpu,${{ matrix.os }}_py-${{ matrix.python-version }}_pt-${{ matrix.pytorch-version }}_${{ matrix.pytorch-dtype }}
+ name: cpu-coverage
diff --git a/README.md b/README.md
index 210475dc7..755d662a3 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,8 @@ English | [简体中文](README_zh-CN.md)
[![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/kornia/shared_invite/zt-csobk21g-2AQRi~X9Uu6PLMuUZdvfjA)
[![Twitter](https://img.shields.io/twitter/follow/kornia_foss?style=social)](https://twitter.com/kornia_foss)
-[![tests-cpu](https://github.com/kornia/kornia/actions/workflows/tests_cpu.yml/badge.svg)](https://github.com/kornia/kornia/actions/workflows/tests_cpu.yml)
+[![tests-cpu](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu.yml/badge.svg?event=schedule&&branch=master)](https://github.com/kornia/kornia/actions/workflows/scheduled_test_cpu.yml)
+[![tests-cpu-nightly](https://github.com/kornia/kornia/actions/workflows/tests_nightly.yml/badge.svg?event=schedule&&branch=master)](https://github.com/kornia/kornia/actions/workflows/tests_nightly.yml)
[![tests-cuda](https://github.com/kornia/kornia/actions/workflows/tests_cuda.yml/badge.svg)](https://github.com/kornia/kornia/actions/workflows/tests_cuda.yml)
[![codecov](https://codecov.io/gh/kornia/kornia/branch/master/graph/badge.svg?token=FzCb7e0Bso)](https://codecov.io/gh/kornia/kornia)
[![Documentation Status](https://readthedocs.org/projects/kornia/badge/?version=latest)](https://kornia.readthedocs.io/en/latest/?badge=latest)