From ddeab364167d6ed62b024a199dcdab5d62191c05 Mon Sep 17 00:00:00 2001 From: vitrinekast Date: Tue, 7 Jan 2025 11:51:20 +0100 Subject: [PATCH] test a python action --- .gitea/workflows/demo.yaml | 27 ++++++++++++++++++--------- app.py | 5 +++-- requirements.txt | 11 +---------- temp.py | 4 ++++ 4 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 temp.py diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 394c807..966f6d5 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -1,19 +1,28 @@ name: Gitea Actions Demo run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] + +on: + push: + branches: ["main"] jobs: - Explore-Gitea-Actions: + compile-html: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - name: Check out repository code uses: actions/checkout@v4 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: "3.9.6" + + - name: Install dependencies run: | - ls ${{ gitea.workspace }} + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run the python application + run: python test.py + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/app.py b/app.py index 2bc0e70..6a0abd1 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,6 @@ from pathlib import Path import shutil import csv import re -import datetime from jinja2 import Environment, PackageLoader, select_autoescape import frontmatter @@ -161,8 +160,10 @@ def main(): [f"{Path(path).stem}.jinja", "post.jinja"]) page = get_page_data(path) render_single_file(template, page, path, OUTPUT_D) + elif Path(path).suffix in [".csv"]: + print("not compiling this file!") else: - print("i cannot handle this file yet") + print("i cannot handle this file yet: ", path) copy_assets() diff --git a/requirements.txt b/requirements.txt index ced814a..8b058c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1 @@ -importlib_metadata==8.5.0 -Jinja2==3.1.4 -Markdown==3.7 -markdown-include==0.8.1 -MarkupSafe==3.0.2 -python-frontmatter==1.1.0 -python-slugify==8.0.4 -PyYAML==5.1 -text-unidecode==1.3 -zipp==3.21.0 +python-slugify==8.0.4 \ No newline at end of file diff --git a/temp.py b/temp.py new file mode 100644 index 0000000..c317258 --- /dev/null +++ b/temp.py @@ -0,0 +1,4 @@ +from slugify import slugify + +print('hello from python!') +print(slugify("i used to have spaces")) \ No newline at end of file