Add .gitea/workflows/python-test.yml
This commit is contained in:
24
.gitea/workflows/python-test.yml
Normal file
24
.gitea/workflows/python-test.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Python Test
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
python-hello:
|
||||||
|
runs-on: [ubuntu-latest]
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Python 3 if missing
|
||||||
|
run: |
|
||||||
|
if ! command -v python3 >/dev/null; then
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y python3 python3-venv python3-pip
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Verify Python installation
|
||||||
|
run: python3 --version
|
||||||
|
|
||||||
|
- name: Run “Hello, Python!”
|
||||||
|
run: |
|
||||||
|
echo 'print("Hello, Python!")' > main.py
|
||||||
|
python3 main.py
|
Reference in New Issue
Block a user