Skip to content

Commit d14374e

Browse files
fix #622 improve ci (#624)
* fix #622 improve ci * Potential fix for code scanning alert no. 3: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 30a2383 commit d14374e

File tree

2 files changed

+71
-7
lines changed

2 files changed

+71
-7
lines changed

.github/workflows/ci-package.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: CI Package
33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- 'src/ffmpeg/**'
68
pull_request:
79
branches: [main]
10+
paths:
11+
- 'src/ffmpeg/**'
812

913
permissions:
1014
contents: read
@@ -48,7 +52,7 @@ jobs:
4852
- name: Run tests
4953
run: |
5054
source .venv/bin/activate
51-
pytest src --cov=./src --cov-report=xml
55+
pytest src/ffmpeg --cov=./src/ffmpeg --cov-report=xml
5256
- name: Upload coverage to Codecov
5357
uses: codecov/codecov-action@v5
5458
with:
@@ -58,12 +62,7 @@ jobs:
5862
token: ${{ secrets.CODECOV_TOKEN }}
5963
verbose: true
6064

61-
- name: Build Mkdocs
62-
run: |
63-
source .venv/bin/activate
64-
mkdocs build
65-
6665
# Run linting
6766
- name: Linting
6867
run: uv run pre-commit run --all-files
69-
working-directory: src
68+
working-directory: src/ffmpeg

.github/workflows/ci-scripts.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI Scripts
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- 'src/**'
11+
pull_request:
12+
branches: [main]
13+
paths:
14+
- 'src/**'
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: Set up Python 3.10
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.10'
28+
29+
- name: Install GCC and ffmpeg
30+
run: sudo apt-get update && sudo apt-get install -y build-essential nasm ffmpeg && ffmpeg -version
31+
32+
- name: Install uv
33+
run: pip install uv
34+
35+
- name: Create virtual environment
36+
run: uv venv
37+
38+
- name: Install dependencies
39+
run: |
40+
source .venv/bin/activate
41+
uv pip install -r requirements.txt
42+
43+
- name: Run tests
44+
run: |
45+
source .venv/bin/activate
46+
pytest src/scripts --cov=./src/scripts --cov-report=xml
47+
48+
- name: Upload coverage to Codecov
49+
uses: codecov/codecov-action@v5
50+
with:
51+
file: ./coverage.xml
52+
flags: scripts,python-3.10
53+
name: scripts-coverage
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
verbose: true
56+
57+
- name: Build Mkdocs
58+
run: |
59+
source .venv/bin/activate
60+
mkdocs build
61+
62+
# Run linting
63+
- name: Linting
64+
run: uv run pre-commit run --all-files
65+
working-directory: src/scripts

0 commit comments

Comments
 (0)