-
Notifications
You must be signed in to change notification settings - Fork 19
54 lines (52 loc) · 1.87 KB
/
Copy pathpr-safety.yml
File metadata and controls
54 lines (52 loc) · 1.87 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
name: PR safety
on:
pull_request:
branches: [master]
jobs:
hosted-pr-checks:
name: Hosted PR checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
persist-credentials: false
- id: classify
name: Classify changes
shell: bash
run: |
set -euo pipefail
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"
changed="$(git diff --name-only "$base" "$head")"
printf '%s\n' "$changed"
if printf '%s\n' "$changed" | grep -Eq '^(mcp_video/|tests/|pyproject\.toml|uv\.lock|\.github/workflows/pr-safety\.yml)'; then
echo "code=true" >> "$GITHUB_OUTPUT"
else
echo "code=false" >> "$GITHUB_OUTPUT"
fi
- name: Skip hosted checks
if: steps.classify.outputs.code != 'true'
run: echo "Code inputs unchanged; marking hosted PR checks successful."
- name: Install FFmpeg
if: steps.classify.outputs.code == 'true'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ffmpeg
ffmpeg -version
ffprobe -version
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
if: steps.classify.outputs.code == 'true'
with:
python-version: "3.13"
- name: Install package
if: steps.classify.outputs.code == 'true'
run: python -m pip install -e ".[dev]"
- name: Lint
if: steps.classify.outputs.code == 'true'
run: |
ruff check mcp_video/ tests/
ruff format --check mcp_video/ tests/
- name: Test
if: steps.classify.outputs.code == 'true'
run: pytest tests/ -q -m "not slow" --tb=short