mirror of
https://github.com/tomasriveral/ReSSPublica.git
synced 2026-08-12 02:38:37 +02:00
CI: fix launching and logging
This commit is contained in:
@@ -2,9 +2,15 @@ name: Build RSS feeds
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 6 * * *" # Runs once per day at 06:00 UTC
|
- cron: "0 6 * * *" # daily at 06:00 UTC
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
verbose:
|
||||||
|
description: "Enable verbose logging"
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -21,26 +27,31 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: "3.14"
|
python-version: "3.14"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install package
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install sparqlwrapper feedgen lxml tinydb
|
pip install .
|
||||||
|
|
||||||
- name: Set environment variables
|
- name: Prepare cache directory
|
||||||
run: |
|
run: |
|
||||||
echo "RESSPUBLICA_CACHE=$GITHUB_WORKSPACE/.cache" >> $GITHUB_ENV
|
echo "RESSPUBLICA_CACHE=$GITHUB_WORKSPACE/.cache" >> $GITHUB_ENV
|
||||||
mkdir -p "$GITHUB_WORKSPACE/.cache"
|
mkdir -p "$GITHUB_WORKSPACE/.cache"
|
||||||
|
|
||||||
- name: Generate feeds
|
- name: Generate feeds
|
||||||
run: |
|
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
|
- name: Commit and push changes
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
git add .
|
git add feed/ .cache/
|
||||||
|
|
||||||
if git diff --cached --quiet; then
|
if git diff --cached --quiet; then
|
||||||
echo "No changes to commit"
|
echo "No changes to commit"
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ def generateFederalFeed():
|
|||||||
results = sparql.query().convert()
|
results = sparql.query().convert()
|
||||||
|
|
||||||
logger.info("Query succesfully returned. Processing the feeds.")
|
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"))
|
now = datetime.now(ZoneInfo("Europe/Zurich"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user