-
Notifications
You must be signed in to change notification settings - Fork 9
147 lines (124 loc) · 4.55 KB
/
test_n_pub.yml
File metadata and controls
147 lines (124 loc) · 4.55 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: Run Tests
on:
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:
jobs:
tests:
name: Python ${{ matrix.python-version }} • ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]
# python-version: [3.7, 3.8, 3.9]
# os: [windows-latest]
exclude:
- os: macos-latest
python-version: 3.9
- os: windows-latest
python-version: 3.9
- os: macos-latest
python-version: 3.10
- os: windows-latest
python-version: 3.10
- os: macos-latest
python-version: 3.11
- os: windows-latest
python-version: 3.11
- os: macos-latest
python-version: 3.12
- os: windows-latest
python-version: 3.12
steps:
- run: echo ${{github.ref}}
- uses: actions/checkout@v4
# - name: Set up FFmpeg
# uses: FedericoCarboni/setup-ffmpeg@v3
# with:
# # A specific version to download, may also be "release" or a specific version
# # like "6.1.0". At the moment semver specifiers (i.e. >=6.1.0) are supported
# # only on Windows, on other platforms they are allowed but version is matched
# # exactly regardless.
# ffmpeg-version: release
# # Target architecture of the ffmpeg executable to install. Defaults to the
# # system architecture. Only x64 and arm64 are supported (arm64 only on Linux).
# architecture: 'x64'
# # As of version 3 of this action, builds are no longer downloaded from GitHub
# # except on Windows: https://github.com/GyanD/codexffmpeg/releases.
# github-token: ${{ github.server_url == 'https://github.com' && github.token || '' }}
- name: Setup FFmpeg
uses: AnimMouse/setup-ffmpeg@v1
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
- name: Setup Python dependencies
run: |
python -m pip install -U pip
pip install -U build pytest pytest-github-actions-annotate-failures
- name: Install ffmpegio package
run: pip install -q . numpy
- name: Run tests
run: pytest -vv
test_no_ffmpeg:
name: Make sure ffmpegio imports when no ffmpeg installed
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
steps:
- run: echo ${{github.ref}}
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
- name: Setup Python dependencies
run: |
python -m pip install -U pip
- name: Install ffmpegio package
run: pip install -q .
- name: Run Python just to import ffmpegio to make sure won't error out
run: python -c "import ffmpegio, ffmpegio.filtergraph"
distribute:
name: Distribution
runs-on: ubuntu-latest
permissions: write-all
needs: [tests, test_no_ffmpeg]
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Setup Python dependencies
run: |
python -m pip install -U pip setuptools
pip install -U build
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: add python distribution files to release
uses: softprops/action-gh-release@v2
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
# skip_existing: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}