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:
parent
083a0a5ab1
commit
c49707e404
4 changed files with 18 additions and 6 deletions
5
.forgejo/actions/python/Dockerfile
Normal file
5
.forgejo/actions/python/Dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
FROM python:3.12.5
|
||||
|
||||
ADD *.sh /
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
5
.forgejo/actions/python/action.yaml
Normal file
5
.forgejo/actions/python/action.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
name: "Run Python Tests"
|
||||
description: "Runs the Python Tests"
|
||||
runs:
|
||||
using: "docker"
|
||||
image: "Dockerfile"
|
6
.forgejo/actions/python/entrypoint.sh
Executable file
6
.forgejo/actions/python/entrypoint.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
python3 -V
|
||||
python3 tests.py
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue