-
Notifications
You must be signed in to change notification settings - Fork 492
147 lines (142 loc) · 5.86 KB
/
release-test.yml
File metadata and controls
147 lines (142 loc) · 5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Release Test Suite
on:
workflow_dispatch:
push:
tags:
- 'v*-release'
jobs:
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine pip-audit
- name: Version consistency check
run: |
# Parse __version__ directly so we don't have to install scenedetect
# (importing it triggers a cv2-availability guard).
VERSION=$(python -c "import ast,pathlib; print(next(n.value.value for n in ast.parse(pathlib.Path('scenedetect/__init__.py').read_text()).body if isinstance(n, ast.Assign) and any(getattr(t,'id',None)=='__version__' for t in n.targets)))")
echo "scenedetect.__version__ = $VERSION"
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG_VERSION=${GITHUB_REF#refs/tags/v}
TAG_VERSION=${TAG_VERSION%-release}
if [[ "$VERSION" != "$TAG_VERSION" ]]; then
echo "Version mismatch: scenedetect=$VERSION, tag=$TAG_VERSION"
exit 1
fi
if ! grep -q "^## PySceneDetect $TAG_VERSION" website/pages/changelog.md; then
echo "Changelog is missing a '## PySceneDetect $TAG_VERSION' heading"
exit 1
fi
fi
- name: Build and Check
run: |
# Build to a clean output dir — `dist/` already holds tracked installer
# scripts and config (e.g. dist/generate_assets.py, dist/installer/),
# so `twine check dist/*` would try to validate non-distribution files.
python -m build --outdir build-dist
twine check build-dist/*
- name: pip-audit
# CVE-2026-3219 in pip 26.0.1 has no fix version available upstream
# and pip ships pre-installed on the runner (not controlled by this
# project). Re-evaluate when pip publishes a fix.
run: pip-audit --ignore-vuln CVE-2026-3219
release-tests:
needs: static
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.13']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Checkout resources branch
run: |
git fetch --depth=1 origin refs/heads/resources:refs/remotes/origin/resources
git checkout refs/remotes/origin/resources -- tests/resources/
git reset
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install ffmpeg
uses: ./.github/actions/setup-ffmpeg
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[opencv,pyav,moviepy]
pip install opentimelineio pillow psutil pytest
- name: Run release tests
run: pytest -m release -vv --ignore=tests/release/test_long_video_stress.py --ignore=tests/release/test_install_matrix.py
long-stress:
needs: static
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout resources branch
run: |
git fetch --depth=1 origin refs/heads/resources:refs/remotes/origin/resources
git checkout refs/remotes/origin/resources -- tests/resources/
git reset
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install ffmpeg
uses: ./.github/actions/setup-ffmpeg
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[opencv,pyav]
pip install psutil pytest
- name: Run long stress test
run: pytest -m release -k long_video -vv
install-matrix:
needs: static
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Checkout resources branch
run: |
git fetch --depth=1 origin refs/heads/resources:refs/remotes/origin/resources
git checkout refs/remotes/origin/resources -- tests/resources/
git reset
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build wheel
run: |
pip install build
python -m build --wheel --outdir build-dist
# TODO(v0.7): Split scenedetect into multiple packages for the headless OpenCV variant so
# that we can do pip install scenedetect without needing to specify [opencv], since the vast
# majority of users install it this way. This was to allow a headless variant instead, but
# we should use a different package name entirely.
- name: Test OpenCV Install
shell: bash
run: |
WHEEL=$(ls build-dist/*.whl)
PY=${{ matrix.os == 'windows-latest' && 'venv_opencv/Scripts/python' || 'venv_opencv/bin/python' }}
PYTEST=${{ matrix.os == 'windows-latest' && 'venv_opencv/Scripts/pytest' || 'venv_opencv/bin/pytest' }}
python -m venv venv_opencv
$PY -m pip install pytest "${WHEEL}[opencv]"
$PYTEST tests/release/test_install_matrix.py -m release -k test_opencv_only
- name: Test PyAV Install
shell: bash
run: |
WHEEL=$(ls build-dist/*.whl)
PY=${{ matrix.os == 'windows-latest' && 'venv_pyav/Scripts/python' || 'venv_pyav/bin/python' }}
PYTEST=${{ matrix.os == 'windows-latest' && 'venv_pyav/Scripts/pytest' || 'venv_pyav/bin/pytest' }}
python -m venv venv_pyav
$PY -m pip install pytest "${WHEEL}[pyav]"
$PYTEST tests/release/test_install_matrix.py -m release -k test_pyav_only