Skip to content

Commit 6ba3b47

Browse files
authored
Merge pull request #1 from whyb/testci
Add Test CI
2 parents 89402d1 + 7cf4d09 commit 6ba3b47

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.github/workflows/run-test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Windows CI for HwCodecDetect
2+
3+
on:
4+
push:
5+
branches: [ main, testci ]
6+
pull_request:
7+
branches: [ main, testci ]
8+
9+
jobs:
10+
test-on-windows:
11+
runs-on: windows-latest
12+
13+
defaults:
14+
run:
15+
shell: pwsh
16+
17+
env:
18+
PYTHONIOENCODING: utf-8
19+
20+
steps:
21+
- name: Clone HwCodecDetect
22+
run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git
23+
24+
- name: Upgrade pip
25+
run: python -m pip install --upgrade pip
26+
working-directory: HwCodecDetect
27+
28+
- name: Install dependencies
29+
run: python -m pip install -r requirements.txt
30+
working-directory: HwCodecDetect
31+
32+
- name: Run tests
33+
run: python -m src.HwCodecDetect.run_tests
34+
working-directory: HwCodecDetect

src/HwCodecDetect/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# HwCodecDetect/__init__.py
2-
2+
import os
33
from .install_ffmpeg_if_needed import install_ffmpeg_if_needed
4-
from .version import __version__
54

5+
def _read_version():
6+
try:
7+
version_path = os.path.join(os.path.dirname(__file__), '..', '..', 'VERSION')
8+
with open(version_path, encoding='utf-8') as f:
9+
return f.read().strip()
10+
except Exception:
11+
return "0.0.0"
12+
13+
__version__ = _read_version()
614
__author__ = "whyb"
715
__email__ = "whyber@outlook.com"
816
__license__ = "BSD-3-Clause"

0 commit comments

Comments
 (0)