|
| 1 | +name: Release Test Suite |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - 'v*-release' |
| 8 | + |
| 9 | +jobs: |
| 10 | + static: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - name: Set up Python |
| 15 | + uses: actions/setup-python@v5 |
| 16 | + with: |
| 17 | + python-version: '3.10' |
| 18 | + - name: Install dependencies |
| 19 | + run: | |
| 20 | + python -m pip install --upgrade pip |
| 21 | + pip install build twine pip-audit |
| 22 | + - name: Version consistency check |
| 23 | + run: | |
| 24 | + VERSION=$(python -c "import scenedetect; print(scenedetect.__version__)") |
| 25 | + echo "scenedetect.__version__ = $VERSION" |
| 26 | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then |
| 27 | + TAG_VERSION=${GITHUB_REF#refs/tags/v} |
| 28 | + TAG_VERSION=${TAG_VERSION%-release} |
| 29 | + if [[ "$VERSION" != "$TAG_VERSION" ]]; then |
| 30 | + echo "Version mismatch: scenedetect=$VERSION, tag=$TAG_VERSION" |
| 31 | + exit 1 |
| 32 | + fi |
| 33 | + if ! grep -q "^## PySceneDetect $TAG_VERSION" website/pages/changelog.md; then |
| 34 | + echo "Changelog is missing a '## PySceneDetect $TAG_VERSION' heading" |
| 35 | + exit 1 |
| 36 | + fi |
| 37 | + fi |
| 38 | + - name: Build and Check |
| 39 | + run: | |
| 40 | + python -m build |
| 41 | + twine check dist/* |
| 42 | + - name: pip-audit |
| 43 | + run: pip-audit |
| 44 | + |
| 45 | + release-tests: |
| 46 | + needs: static |
| 47 | + strategy: |
| 48 | + matrix: |
| 49 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 50 | + python-version: ['3.10', '3.13'] |
| 51 | + runs-on: ${{ matrix.os }} |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + - name: Checkout resources branch |
| 55 | + run: | |
| 56 | + git fetch --depth=1 origin refs/heads/resources:refs/remotes/origin/resources |
| 57 | + git checkout refs/remotes/origin/resources -- tests/resources/ |
| 58 | + git reset |
| 59 | + - name: Set up Python ${{ matrix.python-version }} |
| 60 | + uses: actions/setup-python@v5 |
| 61 | + with: |
| 62 | + python-version: ${{ matrix.python-version }} |
| 63 | + - name: Install ffmpeg |
| 64 | + uses: ./.github/actions/setup-ffmpeg |
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + python -m pip install --upgrade pip |
| 68 | + pip install .[opencv,pyav,moviepy] |
| 69 | + pip install opentimelineio pillow psutil pytest |
| 70 | + - name: Run release tests |
| 71 | + run: pytest -m release -vv --ignore=tests/release/test_long_video_stress.py --ignore=tests/release/test_install_matrix.py |
| 72 | + |
| 73 | + long-stress: |
| 74 | + needs: static |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + - name: Checkout resources branch |
| 79 | + run: | |
| 80 | + git fetch --depth=1 origin refs/heads/resources:refs/remotes/origin/resources |
| 81 | + git checkout refs/remotes/origin/resources -- tests/resources/ |
| 82 | + git reset |
| 83 | + - name: Set up Python |
| 84 | + uses: actions/setup-python@v5 |
| 85 | + with: |
| 86 | + python-version: '3.10' |
| 87 | + - name: Install ffmpeg |
| 88 | + uses: ./.github/actions/setup-ffmpeg |
| 89 | + - name: Install dependencies |
| 90 | + run: | |
| 91 | + python -m pip install --upgrade pip |
| 92 | + pip install .[opencv,pyav] |
| 93 | + pip install psutil pytest |
| 94 | + - name: Run long stress test |
| 95 | + run: pytest -m release -k long_video -vv |
| 96 | + |
| 97 | + install-matrix: |
| 98 | + needs: static |
| 99 | + strategy: |
| 100 | + matrix: |
| 101 | + os: [ubuntu-latest, windows-latest] |
| 102 | + runs-on: ${{ matrix.os }} |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@v4 |
| 105 | + - name: Checkout resources branch |
| 106 | + run: | |
| 107 | + git fetch --depth=1 origin refs/heads/resources:refs/remotes/origin/resources |
| 108 | + git checkout refs/remotes/origin/resources -- tests/resources/ |
| 109 | + git reset |
| 110 | + - name: Set up Python |
| 111 | + uses: actions/setup-python@v5 |
| 112 | + with: |
| 113 | + python-version: '3.10' |
| 114 | + - name: Build wheel |
| 115 | + run: | |
| 116 | + pip install build |
| 117 | + python -m build --wheel |
| 118 | + - name: Test Bare Install |
| 119 | + shell: bash |
| 120 | + run: | |
| 121 | + WHEEL=$(ls dist/*.whl) |
| 122 | + PY=${{ matrix.os == 'windows-latest' && 'venv_bare/Scripts/python' || 'venv_bare/bin/python' }} |
| 123 | + PYTEST=${{ matrix.os == 'windows-latest' && 'venv_bare/Scripts/pytest' || 'venv_bare/bin/pytest' }} |
| 124 | + python -m venv venv_bare |
| 125 | + $PY -m pip install pytest "$WHEEL" |
| 126 | + $PYTEST -m release -k test_install_bare |
| 127 | + - name: Test OpenCV Install |
| 128 | + shell: bash |
| 129 | + run: | |
| 130 | + WHEEL=$(ls dist/*.whl) |
| 131 | + PY=${{ matrix.os == 'windows-latest' && 'venv_opencv/Scripts/python' || 'venv_opencv/bin/python' }} |
| 132 | + PYTEST=${{ matrix.os == 'windows-latest' && 'venv_opencv/Scripts/pytest' || 'venv_opencv/bin/pytest' }} |
| 133 | + python -m venv venv_opencv |
| 134 | + $PY -m pip install pytest "${WHEEL}[opencv]" |
| 135 | + $PYTEST -m release -k test_opencv_only |
| 136 | + - name: Test PyAV Install |
| 137 | + shell: bash |
| 138 | + run: | |
| 139 | + WHEEL=$(ls dist/*.whl) |
| 140 | + PY=${{ matrix.os == 'windows-latest' && 'venv_pyav/Scripts/python' || 'venv_pyav/bin/python' }} |
| 141 | + PYTEST=${{ matrix.os == 'windows-latest' && 'venv_pyav/Scripts/pytest' || 'venv_pyav/bin/pytest' }} |
| 142 | + python -m venv venv_pyav |
| 143 | + $PY -m pip install pytest "${WHEEL}[pyav]" |
| 144 | + $PYTEST -m release -k test_pyav_only |
0 commit comments