ci: update Forgejo workflow
All checks were successful
test / test (pull_request) Successful in 3s

Run the python tests in a Python container using a custom local action
and a Dockerfile to build the testing environment.

Resolves the issue where setup-python doesn't seem to work with Forgejo
actions (at least for me anyway).
This commit is contained in:
Dan Anglin 2024-08-16 06:46:40 +01:00
parent 083a0a5ab1
commit c49707e404
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
4 changed files with 18 additions and 6 deletions

View file

@ -0,0 +1,5 @@
FROM python:3.12.5
ADD *.sh /
ENTRYPOINT ["/entrypoint.sh"]

View file

@ -0,0 +1,5 @@
name: "Run Python Tests"
description: "Runs the Python Tests"
runs:
using: "docker"
image: "Dockerfile"

View file

@ -0,0 +1,6 @@
#!/bin/sh
set -e
python3 -V
python3 tests.py

View file

@ -13,10 +13,6 @@ jobs:
runs-on: docker
steps:
- name: Checkout Repository
uses: https://code.forgejo.org/actions/checkout@v3
- name: Install Python 3
uses: https://github.com/actions/setup-python@v5
with:
python-version: '3.12.2'
uses: https://code.forgejo.org/actions/checkout@v4
- name: Test Code
run: python tests.py
uses: ./.forgejo/actions/python