-
Notifications
You must be signed in to change notification settings - Fork 10
118 lines (102 loc) · 3.59 KB
/
Copy pathpython-tests.yml
File metadata and controls
118 lines (102 loc) · 3.59 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
name: Tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
checks: write
id-token: write
jobs:
run:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@v7.0.1
- name: Set up MKVToolNix repository
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get -qq update
sudo apt-get -qq install -y wget gnupg
sudo wget -O /usr/share/keyrings/gpg-pub-moritzbunkus.gpg https://mkvtoolnix.download/gpg-pub-moritzbunkus.gpg
UBUNTU_CODENAME=$(lsb_release -cs)
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/ubuntu/ $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/mkvtoolnix.list
sudo apt-get -qq update
- name: Install MKVToolNix (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get -qq install -y mkvtoolnix mkvtoolnix-gui
- name: Install MKVToolNix (macOS)
if: matrix.os == 'macos-latest'
run: brew install --quiet mkvtoolnix
- name: Install MKVToolNix (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install -y --no-progress mkvtoolnix
echo "C:\Program Files\MKVToolNix" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Verify MKVToolNix installation (Windows)
if: matrix.os == 'windows-latest'
run: |
& "C:\Program Files\MKVToolNix\mkvmerge.exe" -V
shell: pwsh
- name: Verify MKVToolNix installation (Linux and macOS)
if: matrix.os != 'windows-latest'
run: mkvmerge -V
- name: Install uv
id: setup-uv
uses: astral-sh/setup-uv@v9.0.0
with:
version: "0.12.1"
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: true
- name: Install project
run: uv sync --all-extras --dev
- name: Run tests and collect coverage
run: uv run --frozen make
shell: bash
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6.0.0
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event_name == 'pull_request' }}
with:
env_vars: OS,PYTHON
files: ./coverage.xml
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v6.4.2
if: success() || failure() # always run even if the previous step fails
with:
report_paths: './test-results/junit.xml'
runtime-import:
name: Runtime-only import smoke test
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Check out repository
uses: actions/checkout@v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
version: "0.12.1"
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: true
- name: Import pymkv without dev dependencies
run: uv run --no-dev python -c "import pymkv"