|
| 1 | +# name: CI |
| 2 | + |
| 3 | +# on: |
| 4 | +# push: |
| 5 | +# branches: |
| 6 | +# - main |
| 7 | +# pull_request: |
| 8 | +# branches: |
| 9 | +# - main |
| 10 | +# - release* |
| 11 | +# schedule: |
| 12 | +# # Nightly run unit tests to check for implicit dependency issues between pull requests. |
| 13 | +# - cron: '0 0 * * *' |
| 14 | +# # Allows you to run this workflow manually from the Actions tab |
| 15 | +# workflow_dispatch: |
| 16 | + |
| 17 | +# defaults: |
| 18 | +# run: |
| 19 | +# shell: bash |
| 20 | + |
| 21 | +# jobs: |
| 22 | +# check_code_formatting: |
| 23 | +# name: Check code formatting with pre-commit |
| 24 | +# runs-on: ubuntu-latest |
| 25 | +# container: python:3.9 |
| 26 | +# steps: |
| 27 | +# - uses: actions/checkout@v4 |
| 28 | +# with: |
| 29 | +# fetch-depth: 0 |
| 30 | +# - uses: actions/cache@v4 |
| 31 | +# id: env-cache |
| 32 | +# with: |
| 33 | +# path: | |
| 34 | +# ~/.cache/pypoetry/virtualenvs/ |
| 35 | +# ~/.local |
| 36 | +# key: python-3.9-${{ hashFiles('poetry.lock') }} |
| 37 | +# - name: Setup Environment |
| 38 | +# uses: ./.github/actions/python-poetry-setup |
| 39 | +# - name: Configure Git safe directory |
| 40 | +# run: git config --global --add safe.directory "$GITHUB_WORKSPACE" |
| 41 | +# - name: Run pre-commit checks |
| 42 | +# run: poetry run pre-commit run --files $(find albumentations -type f) |
| 43 | + |
| 44 | +# check_defaults: |
| 45 | +# name: Check defaults in apply |
| 46 | +# runs-on: ubuntu-latest |
| 47 | +# container: python:3.9 |
| 48 | +# steps: |
| 49 | +# - uses: actions/checkout@v4 |
| 50 | +# with: |
| 51 | +# fetch-depth: 0 |
| 52 | +# - uses: actions/cache@v4 |
| 53 | +# id: env-cache |
| 54 | +# with: |
| 55 | +# path: | |
| 56 | +# ~/.cache/pypoetry/virtualenvs/ |
| 57 | +# ~/.local |
| 58 | +# ~/.cache/pip |
| 59 | +# ~\AppData\Local\pip\Cache |
| 60 | +# ~/Library/Caches/pip |
| 61 | +# key: python-3.9-${{ hashFiles('poetry.lock') }} |
| 62 | +# - name: Setup Environment |
| 63 | +# uses: ./.github/actions/python-poetry-setup |
| 64 | +# - name: Check defaults in apply |
| 65 | +# run: poetry run python -m tools.check_defaults |
| 66 | + |
| 67 | +# check_transforms_docs: |
| 68 | +# name: Check transforms documentation is up to date |
| 69 | +# runs-on: ubuntu-latest |
| 70 | +# container: python:3.9 |
| 71 | +# steps: |
| 72 | +# - uses: actions/checkout@v4 |
| 73 | +# with: |
| 74 | +# fetch-depth: 0 |
| 75 | +# - uses: actions/cache@v4 |
| 76 | +# id: env-cache |
| 77 | +# with: |
| 78 | +# path: | |
| 79 | +# ~/.cache/pypoetry/virtualenvs/ |
| 80 | +# ~/.local |
| 81 | +# ~/.cache/pip |
| 82 | +# ~\AppData\Local\pip\Cache |
| 83 | +# ~/Library/Caches/pip |
| 84 | +# key: python-3.9-${{ hashFiles('poetry.lock') }} |
| 85 | +# - name: Setup Environment |
| 86 | +# uses: ./.github/actions/python-poetry-setup |
| 87 | +# - name: Run checks for documentation |
| 88 | +# run: poetry run python -m tools.make_transforms_docs check README.md |
| 89 | + |
| 90 | +# core: |
| 91 | +# name: Core tests (Python ${{ matrix.python-version }}) |
| 92 | +# runs-on: ${{ matrix.operating-system }} |
| 93 | +# strategy: |
| 94 | +# matrix: |
| 95 | +# operating-system: [ubuntu-latest, windows-latest, macos-latest] |
| 96 | +# python-version: ["3.9", "3.10", "3.11", "3.12"] |
| 97 | +# include: |
| 98 | +# - operating-system: ubuntu-latest |
| 99 | +# path: ~/.cache/pip |
| 100 | +# - operating-system: windows-latest |
| 101 | +# path: ~\AppData\Local\pip\Cache |
| 102 | +# - operating-system: macos-latest |
| 103 | +# path: ~/Library/Caches/pip |
| 104 | +# fail-fast: false |
| 105 | +# container: python:${{ matrix.python-version }} |
| 106 | +# steps: |
| 107 | +# - name: Checkout |
| 108 | +# uses: actions/checkout@v4 |
| 109 | +# with: |
| 110 | +# fetch-depth: 0 |
| 111 | + |
| 112 | +# - name: Set up Python |
| 113 | +# uses: actions/setup-python@v5 |
| 114 | +# with: |
| 115 | +# python-version: ${{ matrix.python-version }} |
| 116 | + |
| 117 | +# - name: Restore Python cache |
| 118 | +# uses: actions/cache/restore@v4 |
| 119 | +# with: |
| 120 | +# path: | |
| 121 | +# ~/.cache/pypoetry/virtualenvs/ |
| 122 | +# ~/.local |
| 123 | +# ~/.cache/pip |
| 124 | +# ~\AppData\Local\pip\Cache |
| 125 | +# ~/Library/Caches/pip |
| 126 | +# key: python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} |
| 127 | +# restore-keys: | |
| 128 | +# python-${{ matrix.python-version }}- |
| 129 | + |
| 130 | +# - name: Setup Environment |
| 131 | +# uses: ./.github/actions/python-poetry-setup |
| 132 | + |
| 133 | +# - name: Replace OpenCV with Headless |
| 134 | +# run: | |
| 135 | +# export PIP_LIST="$(poetry run pip list --format=json)" |
| 136 | +# if (echo "$PIP_LIST" | poetry run ./scripts/pycv2_is_installed.py) |
| 137 | +# then |
| 138 | +# echo "OpenCV-Python installed, replacing with equivalent headless version." |
| 139 | +# VERSION="$(echo "$PIP_LIST" | poetry run ./scripts/pycv2_installed_version.py)" |
| 140 | +# poetry run pip uninstall -y opencv-python opencv-python-headless |
| 141 | +# poetry run pip install --no-deps opencv-python-headless=="$VERSION" |
| 142 | +# else |
| 143 | +# echo "OpenCV-Python NOT installed, skipping." |
| 144 | +# fi |
| 145 | + |
| 146 | +# - name: Run Unittests (core) |
| 147 | +# run: poetry run pytest |
| 148 | + |
| 149 | +# - name: Save Python cache |
| 150 | +# uses: actions/cache/save@v4 |
| 151 | +# with: |
| 152 | +# path: | |
| 153 | +# ~/.cache/pypoetry/virtualenvs/ |
| 154 | +# ~/.local |
| 155 | +# ~/.cache/pip |
| 156 | +# ~\AppData\Local\pip\Cache |
| 157 | +# ~/Library/Caches/pip |
| 158 | +# key: python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} |
| 159 | + |
| 160 | +# - name: Codecov report submission |
| 161 | +# if: github.event_name != 'schedule' |
| 162 | +# uses: codecov/codecov-action@v5 |
| 163 | +# with: |
| 164 | +# token: ${{ secrets.CODECOV_TOKEN || '' }} |
| 165 | +# fail_ci_if_error: true |
| 166 | +# files: coverage.xml |
| 167 | +# flags: unittests |
| 168 | + |
| 169 | +# # extras: |
| 170 | +# # name: Extras tests (Python ${{ matrix.python-version }}, ${{ matrix.opt-extra }}) |
| 171 | +# # needs: core |
| 172 | +# # runs-on: ubuntu-latest |
| 173 | +# # strategy: |
| 174 | +# # matrix: |
| 175 | +# # python-version: ["3.9", "3.10", "3.11", "3.12"] |
| 176 | +# # opt-extra: ["hub", "torch", "text"] |
| 177 | +# # fail-fast: false |
| 178 | +# # container: python:${{ matrix.python-version }} |
| 179 | +# # steps: |
| 180 | +# # - uses: actions/checkout@v4 |
| 181 | +# # with: |
| 182 | +# # fetch-depth: 0 |
| 183 | + |
| 184 | +# # - name: Restore Python cache |
| 185 | +# # uses: actions/cache/restore@v4 |
| 186 | +# # with: |
| 187 | +# # path: | |
| 188 | +# # ~/.cache/pypoetry/virtualenvs/ |
| 189 | +# # ~/.local |
| 190 | +# # ~/.cache/pip |
| 191 | +# # ~\AppData\Local\pip\Cache |
| 192 | +# # ~/Library/Caches/pip |
| 193 | +# # key: python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} |
| 194 | +# # restore-keys: | |
| 195 | +# # python-${{ matrix.python-version }}- |
| 196 | + |
| 197 | +# # - name: Setup Environment |
| 198 | +# # uses: ./.github/actions/python-poetry-setup |
| 199 | + |
| 200 | +# # - name: Install extras |
| 201 | +# # run: poetry install --extras "${{ matrix.opt-extra }}" |
| 202 | + |
| 203 | +# # - name: Replace OpenCV with Headless |
| 204 | +# # run: | |
| 205 | +# # export PIP_LIST="$(poetry run pip list --format=json)" |
| 206 | +# # if (echo "$PIP_LIST" | poetry run ./scripts/pycv2_is_installed.py) |
| 207 | +# # then |
| 208 | +# # echo "OpenCV-Python installed, replacing with equivalent headless version." |
| 209 | +# # VERSION="$(echo "$PIP_LIST" | poetry run ./scripts/pycv2_installed_version.py)" |
| 210 | +# # poetry run pip uninstall -y opencv-python opencv-python-headless |
| 211 | +# # poetry run pip install --no-deps opencv-python-headless=="$VERSION" |
| 212 | +# # else |
| 213 | +# # echo "OpenCV-Python NOT installed, skipping." |
| 214 | +# # fi |
| 215 | + |
| 216 | +# # - name: Run Unittests (extras) |
| 217 | +# # run: poetry run pytest |
| 218 | + |
| 219 | +# # - name: Codecov report submission |
| 220 | +# # if: github.event_name != 'schedule' |
| 221 | +# # uses: codecov/codecov-action@v5 |
| 222 | +# # with: |
| 223 | +# # token: ${{ secrets.CODECOV_TOKEN || '' }} |
| 224 | +# # fail_ci_if_error: true |
| 225 | +# # files: coverage.xml |
| 226 | +# # flags: unittests |
0 commit comments