Files
plex-playlist/.gitea/workflows/checks.yaml
T
copilotcoder a3101c860b
CICD Start / Sanity and Base Decision (pull_request) Successful in 1m10s
Splitting apart the CICD into multiple workflows and linking them together.
Signed-off-by: copilotcoder <copilotcoder@darkhelm.org>
2026-05-28 10:16:56 -04:00

280 lines
9.6 KiB
YAML

name: CICD Checks
on:
workflow_run:
workflows: [ "CICD Main Build" ]
types: [ completed ]
workflow_dispatch:
env:
GITEA_REGISTRY: kankali.darkhelm.lan:3001
GITEA_REGISTRY_IP: 10.18.75.2
GITEA_REGISTRY_HOST: kankali.darkhelm.lan
concurrency:
group: checks-${{ github.event.workflow_run.head_sha || github.sha }}
cancel-in-progress: true
jobs:
route:
name: Route Checks Trigger
runs-on: ubuntu-act
outputs:
run_checks: ${{ steps.route.outputs.run_checks }}
head_sha: ${{ steps.route.outputs.head_sha }}
steps:
- name: Decide whether to run checks
id: route
env:
EVENT_NAME: ${{ github.event_name }}
SOURCE_CONCLUSION: ${{ github.event.workflow_run.conclusion }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
run: |
echo "head_sha=${HEAD_SHA}" >> "$GITHUB_OUTPUT"
if [ "${EVENT_NAME}" = "workflow_dispatch" ]; then
echo "run_checks=true" >> "$GITHUB_OUTPUT"
elif [ "${SOURCE_CONCLUSION}" = "success" ]; then
echo "run_checks=true" >> "$GITHUB_OUTPUT"
else
echo "run_checks=false" >> "$GITHUB_OUTPUT"
fi
trailing-whitespace:
name: Trailing Whitespace Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- &configure_registry_host_step
name: Configure registry host resolution
run: |
if ! grep -q "${GITEA_REGISTRY_HOST}" /etc/hosts; then
echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts
fi
- &ensure_cicd_image_step
name: Ensure CICD image is available
run: |
IMAGE="${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}"
if docker image inspect "${IMAGE}" >/dev/null 2>&1; then
echo "Using cached CICD image: ${IMAGE}"
else
echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | docker login "http://${GITEA_REGISTRY}" -u "${{ secrets.REGISTRY_USER || github.actor }}" --password-stdin
docker pull "${IMAGE}"
fi
- name: Check trailing whitespace with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run trailing-whitespace --all-files --show-diff-on-failure
"
check-yaml:
name: YAML Syntax Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Check YAML files with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run check-yaml --all-files --show-diff-on-failure
"
end-of-file-fixer:
name: End of File Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Check end of file with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run end-of-file-fixer --all-files --show-diff-on-failure
"
check-toml:
name: TOML Syntax Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Check TOML files with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run check-toml --all-files --show-diff-on-failure
"
mixed-line-ending:
name: Mixed Line Ending Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Check line endings with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run mixed-line-ending --all-files --show-diff-on-failure
"
toml-lint:
name: TOML Formatting Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Check TOML formatting with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run pretty-format-toml --all-files --show-diff-on-failure
"
ruff-lint:
name: Ruff Linting
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Run ruff linting with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run ruff --all-files --show-diff-on-failure
"
ruff-format:
name: Ruff Format Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Check ruff formatting with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run ruff-format --all-files --show-diff-on-failure
"
pyright:
name: Pyright Type Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Run pyright type checking with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run pyright --all-files --show-diff-on-failure
"
darglint:
name: Darglint Docstring Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Run darglint docstring linting with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run darglint --all-files --show-diff-on-failure
"
no-docstring-types:
name: No Docstring Types Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Run no docstring types check with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run no-docstring-types --all-files --show-diff-on-failure
"
eslint:
name: ESLint Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Run ESLint with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run eslint --all-files --show-diff-on-failure
"
prettier:
name: Prettier Format Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Check Prettier formatting with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run prettier --all-files --show-diff-on-failure
"
tsdoc-lint:
name: TSDoc Lint Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Run TSDoc linting with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run tsdoc-lint --all-files --show-diff-on-failure
"
typescript-check:
name: TypeScript Type Check
runs-on: ubuntu-act
needs: route
if: needs.route.outputs.run_checks == 'true'
steps:
- *configure_registry_host_step
- *ensure_cicd_image_step
- name: Run TypeScript type checking with pre-commit
run: |
docker run --rm "${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd:${{ needs.route.outputs.head_sha }}" bash -c "
cd /workspace &&
pre-commit run typescript-check --all-files --show-diff-on-failure
"