-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 2.08 KB
/
Copy pathpython-test.yml
File metadata and controls
62 lines (55 loc) · 2.08 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
name: Python Test Reminder
on:
pull_request:
paths:
- '.github/workflows/python-test.yml'
- 'cli/video_subtitle/**'
push:
branches:
- master
paths:
- '.github/workflows/python-test.yml'
- 'cli/video_subtitle/**'
permissions:
contents: read
jobs:
python-test:
name: Python test reminder
runs-on: ubuntu-latest
env:
PYTHON_VERSION: '3.12.x'
PYTHONDONTWRITEBYTECODE: '1'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Run video_subtitle tests as reminder
id: python_test
shell: bash
run: |
set +e
python3 -m pip install -r cli/video_subtitle/requirements.txt
install_status="$?"
if [ "$install_status" -ne 0 ]; then
echo "failed=true" >> "$GITHUB_OUTPUT"
echo "::warning::python3 -m pip install -r cli/video_subtitle/requirements.txt failed with exit code $install_status. Python tests were skipped. This workflow is advisory and does not block release packaging."
exit 0
fi
python3 -m unittest cli/video_subtitle/video_subtitle_test.py 2>&1 | tee python-test.log
status="${PIPESTATUS[0]}"
if [ "$status" -ne 0 ]; then
echo "failed=true" >> "$GITHUB_OUTPUT"
echo "::warning::python3 -m unittest cli/video_subtitle/video_subtitle_test.py failed with exit code $status. This workflow is advisory and does not block release packaging."
else
echo "failed=false" >> "$GITHUB_OUTPUT"
fi
exit 0
- name: Write reminder summary
if: steps.python_test.outputs.failed == 'true'
run: |
echo '## Python test reminder' >> "$GITHUB_STEP_SUMMARY"
echo '' >> "$GITHUB_STEP_SUMMARY"
echo '`python3 -m unittest cli/video_subtitle/video_subtitle_test.py` failed. This workflow is advisory and does not block release packaging.' >> "$GITHUB_STEP_SUMMARY"