This commit is contained in:
Brage Skjønborg 2026-01-21 21:44:45 +01:00
parent 7d5bcc40b0
commit 483c57af69
5 changed files with 88 additions and 36 deletions

View File

@ -16,7 +16,6 @@ on:
required: true required: true
type: boolean type: boolean
jobs: jobs:
build-python: build-python:
if: ${{ inputs.enabled && inputs.shouldBuild }} if: ${{ inputs.enabled && inputs.shouldBuild }}
@ -25,49 +24,85 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# -----------------------------
# Cache pip per app
# -----------------------------
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ inputs.app }}-${{ hashFiles('apps/${{ inputs.app }}/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ inputs.app }}-
# -----------------------------
# Install Python deps
# -----------------------------
- name: Install dependencies - name: Install dependencies
working-directory: apps/${{ inputs.app }}
run: | run: |
cd apps/${{ inputs.app }} if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements.txt ]; then if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
pip install -r requirements.txt
fi
# Install test dependencies (pytest, asyncio test libs, etc.) # -----------------------------
- name: Install test dependencies # Run tests
run: | # -----------------------------
cd apps/${{ inputs.app }}
if [ -f requirements-test.txt ]; then
pip install -r requirements-test.txt
fi
# Run Python tests
- name: Run Python tests - name: Run Python tests
run: | working-directory: apps/${{ inputs.app }}
cd apps/${{ inputs.app }} run: python -m pytest -q
python -m pytest -q
# Build Docker image locally # -----------------------------
- name: Build Docker image locally # Setup Buildx
run: | # -----------------------------
docker build \ - name: Set up Docker Buildx
-f ./dockerfiles/Python \ uses: docker/setup-buildx-action@v3
-t local-${{ inputs.app }}:${{ inputs.dockerTag }} \
--build-arg MODULE_NAME=${{ inputs.app }} \
.
# Smoke-test the container # -----------------------------
- name: Test Docker container # Cache Docker layers per app
run: | # -----------------------------
docker run --rm local-${{ inputs.app }}:${{ inputs.dockerTag }} /bin/sh -c "echo 'Smoke test OK'" - name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-${{ inputs.app }}
key: ${{ runner.os }}-buildx-${{ inputs.app }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ inputs.app }}-
# -----------------------------
# Build image (load locally for smoke test)
# -----------------------------
- name: Build Docker image (local load)
uses: docker/build-push-action@v5
with:
context: .
file: ./dockerfiles/Python
build-args: |
MODULE_NAME=${{ inputs.app }}
load: true
tags: local-${{ inputs.app }}:${{ inputs.dockerTag }}
cache-from: type=local,src=/tmp/.buildx-cache-${{ inputs.app }}
cache-to: type=local,dest=/tmp/.buildx-cache-${{ inputs.app }}-new
# -----------------------------
# Smoke test
# -----------------------------
- name: Smoke test container
run: |
docker run --rm local-${{ inputs.app }}:${{ inputs.dockerTag }} \
/bin/sh -c "echo 'Smoke test OK'"
# -----------------------------
# Docker login
# -----------------------------
- name: Docker login - name: Docker login
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_NAME }} username: ${{ secrets.DOCKER_HUB_NAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }} password: ${{ secrets.DOCKER_HUB_TOKEN }}
# Push final image # -----------------------------
# Push final image (no rebuild)
# -----------------------------
- name: Push Docker image - name: Push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
@ -80,3 +115,13 @@ jobs:
bskjon/mediaprocessing-${{ inputs.app }}:v5 bskjon/mediaprocessing-${{ inputs.app }}:v5
bskjon/mediaprocessing-${{ inputs.app }}:v5-${{ inputs.dockerTag }} bskjon/mediaprocessing-${{ inputs.app }}:v5-${{ inputs.dockerTag }}
bskjon/mediaprocessing-${{ inputs.app }}:v5-${{ github.sha }} bskjon/mediaprocessing-${{ inputs.app }}:v5-${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache-${{ inputs.app }}
cache-to: type=local,dest=/tmp/.buildx-cache-${{ inputs.app }}-new
# -----------------------------
# Move Docker cache
# -----------------------------
- name: Move Docker cache
run: |
rm -rf /tmp/.buildx-cache-${{ inputs.app }}
mv /tmp/.buildx-cache-${{ inputs.app }}-new /tmp/.buildx-cache-${{ inputs.app }}

View File

@ -27,7 +27,11 @@ class CollectEventsListener: EventListener() {
} }
val statusAcceptable = taskStatus.none { it in undesiredStates } val statusAcceptable = taskStatus.none { it in undesiredStates }
if (!statusAcceptable) { if (!statusAcceptable) {
if (taskStatus.any { it == CollectProjection.TaskStatus.Failed }) {
log.warn { "One or more tasks have failed in ${event.referenceId}" } log.warn { "One or more tasks have failed in ${event.referenceId}" }
} else {
log.info { "One or more tasks are still pending in ${event.referenceId}" }
}
return null return null
} }

View File

@ -70,7 +70,7 @@ class MediaDetermineSubtitleTrackTypeListener: EventListener() {
} }
private fun List<SubtitleItem>.onlySupportedCodecs(): List<SubtitleItem> { private fun List<SubtitleItem>.onlySupportedCodecs(): List<SubtitleItem> {
return this.filter { it.stream.codec_type in supportedCodecs } return this.filter { it.stream.codec_name in supportedCodecs }
} }
} }

View File

@ -1,5 +1,5 @@
[versions] [versions]
eventi = "1.0-rc19" eventi = "1.0-rc20"
exfl = "1.0-rc1" exfl = "1.0-rc1"
[libraries] [libraries]

View File

@ -71,10 +71,11 @@ class FlywayAutoConfig(
.load() .load()
val pending = flyway.info().pending() val pending = flyway.info().pending()
var migrationsToApply = true
when { when {
pending.isEmpty() -> { pending.isEmpty() -> {
log.info(" Flyway is up to date. No migrations to apply.") log.info(" Flyway is up to date. No migrations to apply.")
migrationsToApply = false
} }
else -> { else -> {
@ -87,9 +88,11 @@ class FlywayAutoConfig(
if (result.migrationsExecuted > 0) { if (result.migrationsExecuted > 0) {
log.info("✅ Applied ${result.migrationsExecuted} migration(s).") log.info("✅ Applied ${result.migrationsExecuted} migration(s).")
} else { } else {
if (migrationsToApply) {
log.info(" No migrations were applied.") log.info(" No migrations were applied.")
} }
} }
}
} }