CI: fix launching and logging

This commit is contained in:
2026-06-15 16:42:18 +02:00
parent 4b98e4e32d
commit 9e119ea02b
2 changed files with 18 additions and 6 deletions
+17 -6
View File
@@ -2,9 +2,15 @@ name: Build RSS feeds
on:
schedule:
- cron: "0 6 * * *" # Runs once per day at 06:00 UTC
- cron: "0 6 * * *" # daily at 06:00 UTC
workflow_dispatch:
inputs:
verbose:
description: "Enable verbose logging"
required: false
default: "false"
type: boolean
jobs:
build:
@@ -21,26 +27,31 @@ jobs:
with:
python-version: "3.14"
- name: Install dependencies
- name: Install package
run: |
python -m pip install --upgrade pip
pip install sparqlwrapper feedgen lxml tinydb
pip install .
- name: Set environment variables
- name: Prepare cache directory
run: |
echo "RESSPUBLICA_CACHE=$GITHUB_WORKSPACE/.cache" >> $GITHUB_ENV
mkdir -p "$GITHUB_WORKSPACE/.cache"
- name: Generate feeds
run: |
python resspublica/main.py
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.verbose }}" = "true" ]; then
echo "Running in VERBOSE mode"
resspublica --verbose
else
resspublica
fi
- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git add feed/ .cache/
if git diff --cached --quiet; then
echo "No changes to commit"
+1
View File
@@ -88,6 +88,7 @@ def generateFederalFeed():
results = sparql.query().convert()
logger.info("Query succesfully returned. Processing the feeds.")
logger.info(f"Lenght of the return: {len(results["results"]["bindings"])}\nShould be greater or equal than 550 if the query limit wasn't overriden.")
now = datetime.now(ZoneInfo("Europe/Zurich"))