120 lines
3.1 KiB
YAML
120 lines
3.1 KiB
YAML
name: FFmpeg Handling CI
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- main
|
|
paths:
|
|
- "ffmpeg_handling/**"
|
|
- "serverlibrary/**"
|
|
- ".gitea/workflows/ffmpeg_handling.yaml"
|
|
pull_request:
|
|
branches:
|
|
- dev
|
|
paths:
|
|
- "ffmpeg_handling/**"
|
|
- "serverlibrary/**"
|
|
- ".gitea/workflows/ffmpeg_handling.yaml"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: nikolaik/python-nodejs:python3.12-nodejs20
|
|
|
|
steps:
|
|
- name: Check out the tested commit
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install FFmpeg
|
|
run: |
|
|
apt-get update
|
|
apt-get install --yes --no-install-recommends ffmpeg
|
|
|
|
- name: Install ffmpeg_handling
|
|
working-directory: ffmpeg_handling
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install ../serverlibrary .
|
|
|
|
- name: Run tests
|
|
working-directory: ffmpeg_handling
|
|
run: python src/ffmpeg_handling/run_test.py
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: nikolaik/python-nodejs:python3.12-nodejs20
|
|
|
|
steps:
|
|
- name: Check out the tested commit
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Ruff
|
|
run: python -m pip install ruff
|
|
|
|
- name: Lint ffmpeg_handling
|
|
run: ruff check ffmpeg_handling/src ffmpeg_handling/tests ffmpeg_handling/main.py
|
|
|
|
build:
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
needs: [test, lint]
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: nikolaik/python-nodejs:python3.12-nodejs20
|
|
|
|
steps:
|
|
- name: Check out the tested commit
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install build dependencies
|
|
working-directory: ffmpeg_handling
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install ../serverlibrary .
|
|
python -m pip install pyinstaller
|
|
|
|
- name: Build one-file executable
|
|
working-directory: ffmpeg_handling
|
|
run: python -m PyInstaller --clean --noconfirm ffmpeg_handling.spec
|
|
|
|
- name: Verify executable
|
|
run: test -x ffmpeg_handling/dist/ffmpeg_handling
|
|
|
|
- name: Upload executable
|
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
|
with:
|
|
name: ffmpeg-handling-build
|
|
path: ffmpeg_handling/dist/ffmpeg_handling
|
|
if-no-files-found: error
|
|
|
|
install:
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
needs: build
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
runner:
|
|
- vivohost
|
|
- quiethost
|
|
- serverhost
|
|
- mediahost
|
|
runs-on: ${{ matrix.runner }}
|
|
|
|
steps:
|
|
- name: Download executable
|
|
uses: https://github.com/christopherHX/gitea-download-artifact@v4
|
|
with:
|
|
name: ffmpeg-handling-build
|
|
path: dist/
|
|
|
|
- name: Install ffmpeg_handling
|
|
run: |
|
|
set -euo pipefail
|
|
install -d -m 755 "$HOME/tools"
|
|
install -m 755 dist/ffmpeg_handling "$HOME/tools/ffmpeg_handling"
|